Server setup clarification

I am in the middle of setting up a new docker instance and looking at the env variables I am a little confused.

  - N8N_BASIC_AUTH_ACTIVE=true
  - N8N_BASIC_AUTH_USER
  - N8N_BASIC_AUTH_PASSWORD
  - N8N_HOST=${SUBDOMAIN}.${DOMAIN_NAME}
  - N8N_PORT=5678
  - N8N_PROTOCOL=https
  - NODE_ENV=production
  - WEBHOOK_TUNNEL_URL=https://${SUBDOMAIN}.${DOMAIN_NAME}/
  - VUE_APP_URL_BASE_API=https://${SUBDOMAIN}.${DOMAIN_NAME}/

It all makes sense to me except for the N8N_HOST and N8N_PROTOCOL.

Is N8N_HOST used for the listen of the socket? Why wouldn’t that be 127.0.0.1 or 0.0.0.0? All the external routes should be covered by WEBHOOK_TUNNEL_URL and VUE_APP_URL_BASE_API. Why is there a N8N_PROTOCOL?

What am I missing?

Yes you are totally right, that is currently not important. You can find that information also here:

1 Like

Hm. I still find the docs or even the impl confusing.

The N8N_HOST still seems to matter with the base URLs set for the bind address. And frankly speaking I’d make it explicit and always required the base URLs.

The very least I’d change the docs to N8N_HOST=0.0.0.0 to hint at it.

Why do you think that? Here is the regarding code:

As you can see that all it cares about is the port.

Arg, my docker config has covered that up. My mistake. So you cannot even set a bind address at all? Is the listen a wrapper around express?

I’d propose to add a N8N_BIND or N8N_LISTEN. And I would also deprecate the N8N_HOST and just require the base URLs.

That would make things much clearer IMO.

Exactly right now there is no bind address at all.

No listen is directly plain old express:

Thanks a lot for your proposal! Yes, agree that it should be improved in the future which will happen. That will, however, happen later with a larger update to improve with also other things and make everything future-proof.

1 Like

Nice. Then it’s at least a low hanging fruit. Just another parameter.
But no rush from my side. I can control it via docker for now.