Learn how to change the base URL in n8n with clear steps to improve security, access, and workflow reliability in your automation setup.

Book a call with an Expert
Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.
You change the base URL in n8n by setting the environment variable N8N_HOST and (optionally) N8N_PORT, then ensuring your reverse‑proxy (like Nginx, Traefik, or Caddy) points to that same hostname. In almost all production setups, the real change happens in the environment variables + your DNS + your proxy. n8n itself does not have a UI field called “Base URL” — it reads it from environment variables.
n8n decides its own public-facing URL based on environment variables. The important ones are:
Here is what a typical Docker setup looks like when you change the base URL:
environment:
- N8N_HOST=automations.example.com
- N8N_PORT=5678
- N8N_PROTOCOL=https
- WEBHOOK_URL=https://automations.example.com/ // Ensures external-facing webhooks are correct
After you change these variables, restart the container. n8n will regenerate webhook URLs and treat your new domain as authoritative.
n8n uses the base URL for:
If the base URL is wrong, you get webhook failures, OAuth auth problems, and broken system links.
Almost every production n8n uses a reverse proxy (Traefik/Nginx/Caddy) to handle HTTPS. In that case:
If you only change the reverse proxy config but not n8n’s environment variables, you’ll often see webhook URLs still pointing to localhost — that’s a common pitfall.
n8n sometimes needs a separate explicit URL for webhooks, especially when running inside containers or behind proxies. That’s why WEBHOOK\_URL exists. If you see webhook calls failing or pointing to the wrong place, set it manually:
WEBHOOK_URL=https://automations.example.com/
This overrides internal guesses and forces n8n to generate the correct external URLs.
If you follow the above, your base URL will be correct, and n8n will generate valid webhook and OAuth URLs for real production use.
When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.