n8n Webhook URL Shows localhost

Workaround available Self-hosted (Docker, Railway, VPS) Updated October 21, 2026

Quick answer

On self-hosted n8n, webhook and OAuth URLs show http://localhost:5678 when n8n doesn't know its public address. Set WEBHOOK_URL (and N8N_HOST/N8N_PROTOCOL) to your public domain and restart.

Most likely fix: Set the public URL environment variables.

Symptoms

Webhook node shows localhost:5678 URLs even though n8n runs on a public domain; external services can't reach the webhook; OAuth redirects point to localhost.

Why it happens

  • WEBHOOK_URL not set behind a reverse proxy or PaaS
  • Using WEBHOOK_TUNNEL_URL (a dev setting) in production
  • N8N_HOST / N8N_PROTOCOL left at defaults

How to fix it

Try these in order — the most common fix is first.

  1. 1. Set the public URL environment variables

    1. Set WEBHOOK_URL=https://your-domain.com/
    2. Set N8N_HOST=your-domain.com and N8N_PROTOCOL=https
    3. Optionally set N8N_EDITOR_BASE_URL to the same domain
    4. Redeploy or restart the container
  2. 2. Remove development tunnel settings

    1. Delete WEBHOOK_TUNNEL_URL from production config
    2. Restart n8n and re-open the Webhook node to confirm the new URL
  3. 3. Tell n8n about your reverse proxy

    1. Set N8N_PROXY_HOPS=1 if one reverse proxy sits in front of n8n
    2. Match the value to the actual number of proxies in the chain

This guide also covers

  • n8n webhook localhost
  • n8n webhook url localhost 5678
  • n8n WEBHOOK_URL
  • n8n production webhook shows localhost

Still not working?

If n8n keeps failing, you're not alone. See every n8n problem users report or the alternatives people switch to.

Other n8n errors