n8n webhook is directing to localhost

tln-githubTRIAL

7 months ago

I included these variables in the screenshot below using chatgpt to guide me because I couldn't find any documentation to help me set this up.

But whenever I go to my instance of n8n, the webhook base URL is: http://localhost:5678/ which from what I understand wont allow me to connect with other api's online.

Can anyone offer any insight on this?

2 Replies

7 months ago

you need to set the following variable:
WEBHOOK_URL="[https://${{RAILWAY_PUBLIC_DOMAIN](https://${{RAILWAY_PUBLIC_DOMAIN)}}"


7 months ago

and also, any reason to not use the available templates?


tln-githubTRIAL

7 months ago

I had the webhook_url variable set as that, and Im not sure what you mean by available templates. Im very new to web dev and was following a youtube guide. Which templates do you mean?


7 months ago

and just to be sure, did you click the apply changes?


7 months ago

if you just want a simple n8n instance, use my template
https://railway.app/template/MRazvG


tln-githubTRIAL

7 months ago

actually didnt have it set as that, i had it as WEBHOOK_URL="https:mydomain.com". Regardless I changed it to the variable version and still didnt work so I must've messed something up elsewhere.

Ima give your template a try, thanks


7 months ago

did you click the deploy changes button?


7 months ago

every variable change in Railway you'll need to click on this button

1284235294211575800


tln-githubTRIAL

7 months ago

not sure if it said deploy changes specifically but I did restart it and redeploy it like 4 times


7 months ago

thats probably the problem then, try to find that button on your UI, its on center top


tln-githubTRIAL

7 months ago

I rather use yours, mines felt very jerry rigged and it works fine now with the template. Plus this postgres data storage feature is cool.

How does this template handle n8n updates?
The one I had made was connected to a github repo on my acc and I could supposedly update it from within github by syncing it up. Does the template update automatically or are you in control of it?


7 months ago

my template uses the n8n latest docker image so it'll update if you redeploy it


tln-githubTRIAL

7 months ago

Alright cool, I appreciate the help


lbu3n0aiHOBBY

a month ago

@passos, Thank you for sharing this information, I think this is what I need. Question, Where do you deploy this as a global or at the instance? I add a webhook variable at the instance level and I lost my instance. Railway redeploy and all of my work is gone :(. Thanks in advance.


lbu3n0aiHOBBY

a month ago

Update, I just figured it out. Be aware that you will need to redeploy and you'll lose your work so backup for workflow to GitHub or download them. I made that horrible mistake but Luckly the work I had done was imported. You'll need to add this variable to your project. I think you can also add them globally but I'm not 100% on that. You need to add a variable name as below. Hope this helps anyone having this issue
Name value
WEBHOOK_URL https://${{RAILWAY_PUBLIC_DOMAIN}}
N8N_LISTEN_ADDRESS ::

N8N_EDITOR_BASE_URL https://${{RAILWAY_PUBLIC_DOMAIN}}

PORT 5678


n8n webhook is directing to localhost - Railway Help Station