Hey everyone so i have been having some challenges, I am trying to build a whatsapp ai assistant and I run n8n with docker on my local computer. The problem is the test url and production url is showing local host even after setting ENV to ngrok url in portainer.
Describe the problem/error/question
What is the error message (if any)?
Please share your workflow
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
Share the output returned by the last node
Information on your n8n setup
- n8n version: 2.28.2
- Database (default: SQLite): docker
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app): docker
- Operating system: windows
@Stoneage
Did you setup webhook_url to your ngrok subdomain?
Hi @Stoneage Welcome!
The URLs stay on localhost because the variable never actually reaches the container. Portainer’s “Environment variables” panel on a stack only feeds ${VAR} substitution inside the compose file, it does not inject anything into the container, so the service itself has to declare it:
services:
n8n:
environment:
- WEBHOOK_URL=https://your-subdomain.ngrok-free.app/
- N8N_PROXY_HOPS=1
Redeploy the stack so the container is recreated, a plain restart keeps the old env. Then confirm it landed:
docker exec <your-n8n-container> printenv WEBHOOK_URL
Reopen the workflow and the test and production URLs will carry the ngrok host. On the ngrok free plan the subdomain changes on every restart, so the value has to be updated each time unless you use a static domain.