N8n Docker/localhost + ngrok question

I’ve been trying to resolve this issue for days and I can’t seem to find the documentation to help me.

Target: I have n8n 1.100.1 installed on macOS on local, with Docker and I need to expose the production URL for several services.

Problem: I have created an nGrok account, but the production URL it shows me is “localhost…”.

I followed the steps in this post, to configure [.env].

WEBHOOK_TUNNEL_URL='https://some-long-id.ngrok.io'

but it would not be working for me.

I have created these two files

.n8n/n8n-desktop.env
.n8n/.env

and I have also tried with

/n8n/self-hosted-ai-starter-kit/self-hosted-ai-starter-kit/.env

with this configuration

POSTGRES_USER=root
POSTGRES_PASSWORD=password
POSTGRES_DB=n8n

N8N_ENCRYPTION_KEY=super-secret-key
N8N_USER_MANAGEMENT_JWT_SECRET=even-more-secret
N8N_DEFAULT_BINARY_DATA_MODE=filesystem

N8N_DEPLOYMENT_TYPE=‘desktop_mac’
EXECUTIONS_PROCESS=‘main’
EXECUTIONS_DATA_SAVE_ON_PROGRESS=true
EXECUTIONS_DATA_SAVE_MANUAL_EXECUTIONS=true
N8N_BASIC_AUTH_ACTIVE=true
N8N_BASIC_AUTH_USER=‘removed-my-user’
N8N_BASIC_AUTH_PASSWORD=‘removed-my-pass’
N8N_PORT=5679
WEBHOOK_TUNNEL_URL=‘https://thoroughly-supreme-macaw.ngrok-free.app
WEBHOOK_URL=‘https://thoroughly-supreme-macaw.ngrok-free.app

but I still can’t change the Production URL :frowning:

I see that there are many people here with a lot of experience… who may have already gone through these complications.

Please, could someone give me a hint to follow?

I think I’ve exhausted the tests and I wouldn’t know where else to look.

thanks a lot

do you use docker compose or not?

umm… I’m usually starting from Docker desktop. Now I will try as you say

docker compose normally reads .env files automatically.
The docker command does not.
But you can pass an .env file using:
docker run --env-file /path/to/your/.env

How do you start the n8n container?

There is also the option to use a config file, which can be mounted into the container using a volume.

1 Like

humm… I just started with docker compose and the result is the same. :frowning:

Gracias por su feedback @Franz & @cutecatcode :rose:

I did several tests and my surprise is that it does not work as I expected. so I just added:
WEBHOOK_URL='https://thoroughly-macaw.ngrok-free.app'
to
/n8n/self-hosted-ai-starter-kit/.env
and restarted with
docker compose up.

this has worked OK for me and I think it is very natural

I really don’t know where I went wrong with my attempts to pass an .env to it.

I must admit that I have not studied the n8n configuration solidly, but I see that I must do so.

1 Like

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