Webhook URL keeps changing - everytime i run into an error

Everytime i run into an error for testing a development chain - i keep having to restart n8n to get a new tunnel address for the webhook. The error keeps triggering a sudden disconnect and the tunnel service stops working.
Also setting my own subdomain keeps breaking when running this in development mode. If its this fragile in the docker how would one expect to dare running this in a production mode?

Any suggestions how to make this more stable?!

docker run -it --rm --name n8n \
  -p 5678:5678 \
  -e N8N_LISTEN_ADDRESS=:: \
  -e EXPRESS_TRUST_PROXY=true \
  -e N8N_TUNNEL_SUBDOMAIN=<obfuscated> \
  -e N8N_HOST=0.0.0.0 \
  -e N8N_PROTOCOL=https \
  -e N8N_SECURE_COOKIE=true \
  -e N8N_RUNNERS_ENABLED=true \
  -v n8n_data:/home/node/.n8n n8nio/n8n:latest \
  start --tunnel

n8n_version: 1.80.4
database: default
n8n EXECUTIONS_PROCESS: default
Running n8n via: Docker
Operating system: Linux

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

hello @NeoTech

I see multiple issues here

What’s this? EXPRESS_TRUST_PROXY

The variable N8N_HOST should point to the domain, not the IP

You have set it to work with https, however, the port remains the default, plus there is no certificates part.

Seems your instance is not closing properly, so the tunnel doesn’t release the domain.

You should not rely on it at all in production. The instance should be configured via reverse proxy and public domain with a proper SSL certificate

1 Like

Hi @NeoTech n8n is one of the most stable opensource software i ever used, maybe just few config on env part

For a more stable development environment:

  1. Use a persistent webhook URL:
  • Set up a reverse proxy (like Nginx) with a fixed domain
  • Configure n8n to use this domain instead of the tunnel
  1. If you must use the tunnel, try these env vars:
-e WEBHOOK_TUNNEL_URL=https://your-fixed-subdomain.example.com
-e N8N_SKIP_WEBHOOK_DEREGISTRATION_SHUTDOWN=true
  1. For production, definitely use a fixed domain and proper reverse proxy setup.
  2. Consider using Docker Compose for easier configuration management and persistence:
version: '3'
services:
  n8n:
    image: n8nio/n8n
    restart: always
    ports:
      - "5678:5678"
    environment:
      - N8N_HOST=your-domain.com
      - N8N_PROTOCOL=https
      - N8N_PORT=5678
    volumes:
      - n8n_data:/home/node/.n8n

This setup should be much more stable for both development and production use.

If my solution helps address your issue, please consider marking it as the answer! A like would brighten my day if you found it useful! :blush::rocket:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.