Can't fix WEBHOOK_URL, only serves at 'http://localhost'

Describe the problem/error/question

I’m setting up n8n with docker on ubuntu. I set up reverse proxy with Nginx + CertBot, they work fine and I can access the n8n editor in my url https://n8n.chat.adm.br/ . :white_check_mark:

However WEBHOOK test and production urls don’t change even after i set the apparently correct (?) env variables. They remain just this: :x: http://localhost:5678/webhook-test/1345b094-ab1b-418a-986c-fdb6f0bbd53a My .env vars are pasted below.

What is the error message (if any)?

:white_check_mark:no error messages, when running image it apparently is running ok and i can access and use the editor normally.

docker logs

root@srv556089:~/n8n# docker logs -f 5785e24ccaea
Invalid timestamp value for N8N_RELEASE_DATE: $(date -u +"%Y-%m-%dT%H:%M:%SZ")
Permissions 0644 for n8n settings file /home/node/.n8n/config are too wide. This is ignored for now, but in the future n8n will attempt to change the permissions automatically. To automatically enforce correct permissions now set N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true (recommended), or turn this check off set N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=false.
User settings loaded from: /home/node/.n8n/config
Initializing n8n process
n8n ready on 0.0.0.0, port 5678

There is a deprecation related to your environment variables. Please take the recommended actions to update your configuration:
 - N8N_RUNNERS_ENABLED -> Running n8n without task runners is deprecated. Task runners will be turned on by default in a future version. Please set `N8N_RUNNERS_ENABLED=true` to enable task runners now and avoid potential issues in the future. Learn more: https://docs.n8n.io/hosting/configuration/task-runners/

Version: 1.82.3

Editor is now accessible via:
http://localhost:5678

Please share your workflow

  1. I updated the .env variables
  2. ran docker compose down && docker compose up -d --build && docker ps to rebuild with the new env vars
  3. still same problem

.env variables

#db env vars up here
GENERIC_TIMEZONE=America/Fortaleza

N8N_EDITOR_BASE_URL=https://n8n.chat.adm.br/
N8N_HOST=n8n.chat.adm.br

N8N_PORT=5678
N8N_PROTOCOL=https
NODE_ENV=production
WEBHOOK_URL=https://n8n.chat.adm.br/
WEBHOOK_TUNNEL_URL=https://n8n.chat.adm.br/
DOMAIN_NAME=chat.adm.br
SUBDOMAIN=n8n

# path to the HTTPS certificate and key generated by certbot
N8N_SSL_CERT_FILE=/etc/letsencrypt/live/api.chat.adm.br/fullchain.pem
N8N_SSL_KEY_FILE=/etc/letsencrypt/live/api.chat.adm.br/privkey.pem

docker-compose.yaml

version: '3.8'

volumes:
  db_storage:
  n8n_storage:

services:
  postgres:
    image: postgres:16
    restart: always
    environment:
      - POSTGRES_USER
      - POSTGRES_PASSWORD
      - POSTGRES_DB
      - POSTGRES_NON_ROOT_USER
      - POSTGRES_NON_ROOT_PASSWORD
    volumes:
      - db_storage:/var/lib/postgresql/data
      - ./init-data.sh:/docker-entrypoint-initdb.d/init-data.sh
    healthcheck:
      test: ['CMD-SHELL', 'pg_isready -h localhost -U ${POSTGRES_USER} -d ${POSTGRES_DB}']
      interval: 5s
      timeout: 5s
      retries: 10

  n8n:
    image: docker.n8n.io/n8nio/n8n
    restart: always
    environment:
      - DB_TYPE=postgresdb
      - DB_POSTGRESDB_HOST=postgres
      - DB_POSTGRESDB_PORT=5432
      - DB_POSTGRESDB_DATABASE=${POSTGRES_DB}
      - DB_POSTGRESDB_USER=${POSTGRES_NON_ROOT_USER}
      - DB_POSTGRESDB_PASSWORD=${POSTGRES_NON_ROOT_PASSWORD}
    ports:
      - 5678:5678
    links:
      - postgres
    volumes:
      - n8n_storage:/home/node/.n8n
    depends_on:
      postgres:
        condition: service_healthy

Information on your n8n setup

  • n8n version: 1.82.3
  • Database (default: SQLite): Postgresql
  • n8n EXECUTIONS_PROCESS setting (default: own, main): idk, default?
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Ubuntu 24.04.2 LTS

I tried setting only WEBHOOK_URL and rebuilding, didn’t work. I’m using a saved flow with a single webhook cell to test this. I’ve recreated it too.

Also on my pre-last attempt I tried without the certificate paths:

N8N_SSL_CERT_FILE=/etc/letsencrypt/live/api.chat.adm.br/fullchain.pem
N8N_SSL_KEY_FILE=/etc/letsencrypt/live/api.chat.adm.br/privkey.pem

And the docker logs said “unable to generate certificate” or something like that. hence why I tried adding the certificate file paths. But now no errors show after rebuild

post solve edit: this was useless because the docker image will try to find this path inside the container, not on the host machine.

Edit: Solved, I simply had to add the WEBHOOK_URL env var, without a value, in the docker compose file, so docker looks at the .env for it. Most domain related .env vars I added are not needed. :grin: Docker was not loading any of my custom env vars that weren’t listed here.

edit: I actually set these 4. again, set empty in docker compose so docker gets from the .env. but i think just setting webhook_url is enough.

  • WEBHOOK_URL
    • N8N_PROTOCOL=https
    • DOMAIN_NAME
    • SUBDOMAIN
1 Like

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