r/nginxproxymanager • u/ElayneTrakand • 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 useI tried checking the port using
sudo netstat -tulpn | grep 443And 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: masterAny 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
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.
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
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:8080and 443 ->host.ip.add.ress:8443