WEBHOOK_TUNNEL_URL ignored in Docker/Compose on Mac – Production URL always localhost, not ngrok

Absolutely! Here is your forum post translated into English:

# n8n Docker + ngrok: `WEBHOOK_TUNNEL_URL` is ignored (Mac, Docker Desktop, Compose)

## Situation

- **System:** macOS (Apple Silicon), Docker Desktop, n8n (latest: 1.95.3)
- **Goal:** n8n workflows with Telegram Trigger/Webhook Node should be publicly accessible via ngrok (for Telegram webhooks).
- **ngrok:** running, URL is reachable, set as environment variable.
- **Problem:** The Production URL in the Telegram Trigger (and Webhook Node) always remains `http://localhost:5678/...` – the environment variable `WEBHOOK_TUNNEL_URL` is **not** used, even though it is correctly set in the container.

---

## Steps Taken

### 1. Docker Setup

```sh
docker run --env-file /Users/kunkel/n8n-data/env.list \
  -v /Users/kunkel/n8n-data:/home/node/.n8n \
  -p 5678:5678 \
  --name n8n_Main \
  docker.n8n.io/n8nio/n8n

Later with Docker Compose:

services:
  n8n:
    image: n8nio/n8n:latest
    ports:
      - "5678:5678"
    environment:
      - WEBHOOK_TUNNEL_URL=https://<current-ngrok-url>
    volumes:
      - /Users/kunkel/n8n-data:/home/node/.n8n

2. ngrok

  • ngrok is running, URL is publicly reachable (e.g. https://c356-138-199-36-191.ngrok-free.app).
  • URL is always set as the environment variable and container/compose is restarted.

3. Checking the Environment Variable

docker-compose exec n8n printenv | grep WEBHOOK

→ Output is correct:
WEBHOOK_TUNNEL_URL=https://c356-138-199-36-191.ngrok-free.app

4. n8n UI & Trigger

  • Production URL in Telegram Trigger and Webhook Node always shows http://localhost:5678/...
  • Test URL is also local.
  • Workflow cannot be activated:
    Error:
    Bad Request: bad webhook: An HTTPS URL must be provided for webhook

5. Further Tests

  • Tried different browsers, incognito mode, empty volume, cleared compose cache, updated n8n version.
  • Also tested with a minimal compose file and empty data.
  • Always the same behavior.

6. Logs

  • n8n logs show no errors regarding the environment variable.
  • n8n reports:
    Editor is now accessible via: http://localhost:5678
  • No indication that the variable is used or ignored.

7. Workaround Attempts

  • Telegram webhook set manually (works, but not for generic webhooks).
  • Test with Webhook Node: Production URL also remains local.

Screenshots (see chat history for details)

  • Telegram Trigger Production URL:
    Telegram Trigger Production URL
  • Webhook Node Production URL:
    Webhook Node Production URL
  • Docker Compose Start & Logs:
    Docker Compose Start
  • Environment variable in container:
    WEBHOOK_TUNNEL_URL=https://c356-138-199-36-191.ngrok-free.app
    

What has been ruled out?

  • VPN: was disabled, no change.
  • Firewall: was disabled, no change.
  • Browser cache: cleared, no change.
  • Docker Compose: used, variable set correctly.
  • n8n version: up to date (1.95.3).
  • Volume: tested with empty and with data.
  • ngrok: running, URL is reachable.

Assumption / Request to the Community

  • Assumption:
    Either a bug in n8n (Docker, Mac, Compose) or a configuration issue not clearly documented.
  • Question:
    Does anyone know this problem? Is there a known fix?
    Is WEBHOOK_TUNNEL_URL for trigger/webhook nodes in Docker Compose on Mac officially supported?

Workaround Wanted

  • How can n8n be forced to set the Production URL to the ngrok URL?
  • Is there another way to make webhooks in n8n publicly accessible under Docker Desktop/Mac?

Thanks for any help!
(Screenshots and logs can be provided if needed.)

Probably the same as this.

Hi there, im also a mac user self hosting n8n and using ngrok to re route my localhost, but for me i used
WEBHOOK_URL=ngrok_address

you can see it in here as well, if you want to look at other env variables

if this answer your question, please give it a like and mark it as the solution