N8N_PORT 443,80 not listening

Describe the issue/error/question

I try to set ENV
N8N_PORT. 443
N8N_HOST abcd.com

What is the error message (if any)?

I check in container netstat -tulnp port 443 not listening but if I use another port like 4443 is work
how to fix it or I miss something

Share the output returned by the last node

Information on your n8n setup

  • **n8n version: 0.192.1
  • **Database you’re using (default: SQLite): postgrest
  • **Running n8n via [Docker, npm, n8n.cloud, desktop app]: Docker

Hi @Jintawat_Tuitemwong, I just tried running n8n using docker run -it --rm -p 443:443 --name n8n -e N8N_PORT=443 n8nio/n8n:0.192.1 and the n8n container would listen on port 443 as expected (and also expose this port to the host through the -p 443:443 flag.

So I am unfortunately not able to reproduce your problem and n8n seems to work as expected here. Perhaps you can use the standard port inside the container and simply expose port 443 to your host instead?


Thank for reply
expose port is working normal but -p 443:443 is not working because inside container not listen port 443

You could run use -p 443:5678 instead (as in docker run -it --rm -p 443:5678 --name n8n n8nio/n8n:0.192.1). This way, the n8n container would use port 5678 internally, but you can still access n8n via port 443 (http://localhost:443/) of your host.

1 Like

If use default port (5678) is working

and redirect url will be https://abcd.com:5678

but problem is oauth redirect when I try to connect with google service they redirect to https://abcd.com:5678/oauth it will not found URL

1 Like

Perfect, so that’s the first step done. You can overwrite the OAuth redirect URL by setting the WEBHOOK_URL environment variable to the URL your n8n instance is publicly available under.


it working now thank you @MutedJam

1 Like

Glad to hear, thx so much for confirming!

That solves a problem I have spent ca. 5 hours with, trying different reverse proxy, env. variable and container to host port settings.

Please include var WEBHOOK_URL in the documentation!

Background info:

I am using n8n in a Docker behind a reverse proxy (for third level domain) as well, and while no port is necessary for the test URL for webhooks, it was impossible for me to use the production URL of webhooks without port.

Eventually, not to have to use 5678 as port, I assigned 8443 to N8N_PORT since 443 did not work in the container (same problem as OP, it wasn’t listening/exposed) - maybe because of missing assigned certificate?

It worked for me with a production URL webhook including port 8443 (which is not nice, I’d like no port) with the settings shown in the attached images.


Hi @schnill, glad to hear you eventually solved this and sorry for the trouble this has caused in the first place!

That said, this environment variable is part of our documentation:

Let us know if you have any suggestions on improving this part :slight_smile:

I just saw it - it’s just not that obvious - especially since it is not mentioned in the docker section. But that’s just a minor thing, I guess.
Sorry and thanks for replying!

1 Like

Fair enough, while this is part of the docker compose documentation, it is not in docker part of the docs (which just gets n8n up and running without describing the setup around it).

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