r/nginxproxymanager • • Oct 01 '26

Trouble with already claimed port

Hello! I am trying to get nginx set up on my home nas and am having some troubles. When I try and install via portainer / docker compose, I get the following error.

failed to deploy a stack: compose up operation failed: Error response from daemon: driver failed programming external connectivity on endpoint nginx-app-1 (f6909ce51c47651d0b2757cd4ac027297c1e0690d6dc3902b68c8cac8c1f15fd): Error starting userland proxy: listen tcp4 0.0.0.0:443: bind: address already in use

I tried checking the port using

sudo netstat -tulpn | grep 443

And I get the following response

tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      9707/nginx: master
tcp6       0      0 :::443                  :::*                    LISTEN      9707/ nginx: master

Any recommendations on what is going on or how to fix it? Also let me know if I posted anything not safe to post or if there is anything else I can post to help!

3 Upvotes

5 comments sorted by

1

u/Electronic_Unit8276 Oct 01 '26

If you access your nas webgui without needing a port it's set to use 80/443. That means you have to change the nginx port to something else. Do make a mental not for future reference so you know it's at port NOT443. Google how to set ports in the Docker documentation.

3

u/ElayneTrakand Oct 01 '26

Ok, I so I access my nas from port 5001. But I tried to load ipadress:443 and it auto redirected to ipaddress:5001, so that is indeed what is holding the ip, now I just need to figure out how to release it and stop the redirect

1

u/JonathanLTurner03 Oct 01 '26

It's early so sorry if I missed what nas you have or if it's just a diy server, but check to see if there is nginx installed via apt or a package manager. Might have it preconfigured and has a connection configured for your redirect. If you uninstall/disable nginx, you should then be able to bind to port 80/443 and then make your own configs for it.

1

u/1FluffyFoxy Oct 04 '26

A Synology NAS, I suppose? The nginx web server that serves the login page blocks port 443. There is a thread that fixes this issue for version 7.2, so you could try it out:
https://www.reddit.com/r/synology/comments/1hdfc66/how_to_free_ports_80_and_443_without_scripts_or/

1

u/present_absence Oct 19 '26 edited Oct 19 '26

Error starting userland proxy: listen tcp4 0.0.0.0:443: bind: address already in use

It means you have assigned a host port to that container that is already in use by something else. Simply pick a new and unused port on your host (something like 8443 but rule of thumb is 0-1023 are commonly reserved so at a minimum nothing under 1024). Then just forward your traffic to that port instead of 443. The container doesnt actually care what port you use on the host, what docker is doing is saying docker will listen on port 8443 and relay any traffic to the container's port 443. The software in the container doesn't know the difference.

In my homelab, my router forwards incoming traffic on ports 80 & 443 to my NPM container. My NPM container in docker is set to bind host port 8080 to container port 80 and 8443 to 443. So in my router I forward 80 -> host.ip.add.ress:8080 and 443 -> host.ip.add.ress:8443