nginx-proxy-manager: nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
Checklist
- Have you pulled and found the error with
jc21/nginx-proxy-manager:latest
docker image?- Yes
- Are you sure you’re not using someone else’s docker image?
- Yes
- Have you searched for similar issues (both open and closed)?
- Yes
Describe the bug
when I upgrade to the latest “2.10.0” I got
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
Nginx Proxy Manager Version
To Reproduce Run docker with option “network_mode: host”
Expected behavior
Screenshots
Operating System QNAP NAS
Additional context
About this issue
- Original URL
- State: open
- Created a year ago
- Reactions: 57
- Comments: 78 (1 by maintainers)
Please don’t comment with just ‘same here!’. I think it’s clear that there is an issue with the latest release.
Having the same issue with this. I suspect the issue is related to the s6 change and this line in nginx config https://github.com/NginxProxyManager/nginx-proxy-manager/compare/v2.9.22...v2.10.0#diff-45b340b2ff6f4d041ae1aad210aaa0cd31b41139574725ef971a38fab076caa4L4
The issue is not just the
NET_BIND_SERVICE
capability missing from the docker run, its a simple issue with the container itself. A non-root user cannot bind to ports less than1024
. This docker file should give the newnpmuser
permissions to do this.If you are seeing
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
I have found the following to work…Temporary solution (without rollback):
bash
> Okapt update
apt install libcap2-bin
setcap 'cap_net_bind_service=+ep' /usr/sbin/nginx
You should now see nginx proxy manager successfully start! No need to restart the container. The issue with this fix is that if you have something like watchtower running you will lose this on next update until its fixed in the offical docker image.
Good hygine would also be to add the
PUID
andPGID
env vars to a non-root user that lives on your system.Suggested Proper Fix:
Note that the above is NOT reccomended as a permanent fix, and shouldn’t be raised as a PR in the Dockerfile (as it adds portability and security issues - e.g. PSP violations in a locked down k8s cluster).
IMHO, the proper fix will be to move all NPM binds to a different set of ports like 8080… This is probably a bigger change given the config generation. One can bind 80 on their network interfaces to 8080 in the container (i.e.
docker run -p 80:8080 ...
) so you get the behaviour you need… This avoids the need for elevated privileges, since non-root users can bind to ports higher than 1024 and the only way I know how to get this working…For reference on Synology:
It seems that since v2.10.0 the nginx is ran by
npmuser
rather than default (root maybe?), whom might don’t have sufficient permissions to listen on lower ports like 80 & 443. Not sure if this is the cause. 🤔 See full changelogs here: https://github.com/NginxProxyManager/nginx-proxy-manager/compare/v2.9.22...v2.10.0Can confirm, exact same issue. I also reverted back to 2.9.22.
(edit) Changed host network to bridge, to bypass the issue. No other configuration changed. Since NPM config I’m using does not serve high load, I’m going to stick with bridge network for now.
Perhaps you or someone else can give us an update on what is going on to solve this issue instead of giving us Thumb’s down’s Something like: " we see there is an error and we are looking into it. We expect to have a solutions in xx days"
And by the way: I think I added some extra information by telling the communicty that I see this exact same error in the new version 3 NGINX-PM
Same issue with the new image 2.10.1 I’ve tested the same as my previous comment, with PUID and PGID, and without them. The issue persists. I’ve also tried running the container with sudo, to no avail. So it doesn’t seem to be only related to rootless containers.
Same issue here running on Synology with bridge networking. Unfortunately I spent a long time attempting to debug why it coudn’t bind to the port. Stop the container and port 80 became free, start the container at the port is in use via docker-proxy but NPM fails to bind to it.
After deleting everything and attempting to start again, I found it was still the same, permission denied when binding the port. Checked and spotted there’d been a recent update,
Rolling back to 2.9.22 fixes the issue For the time being.
Just realised @stephanvierkant had already mentioned using older release as I had 😃
Same problem running docker on Synology DSM 7.1.1 with Portainer. Reverted back to 2.9.22 and problem resolved.
The release notes mention this:
Users running 2.10.0 won’t be able to run this container rootless apparently (as I’ve been doint with podman). Otherwise this message appears:
And the container stops. Problem is, even when specifying PUID and PGID, the container shows the errors reported in this thread.
Maybe I don’t understand well what the new configuration should be, based on the release notes. If running the container as root is now a requisite, that would be a shame for us rootless users.
Any pointers would be greatly appreciated.
problem solved please let me know thanks.
I had this same issue when I tried to install the beta version of the 3.0. I did try to add the PUID and GUID of root but that did not solve the issue for version 3. But then I thought this is still development so…
But now I have this same issue with version 2.10 I’m running nginx_pm on my Synology.
I used
to revert to 2.9.22.
Same here, reverted to 2.9.22 Synology, docker, portainer, watchtower.
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
This seems to be expected behavior. @maz1987in @Jojonintendo @Candinya @evanlabs
Release notes for 2.9.22 state: https://github.com/NginxProxyManager/nginx-proxy-manager/releases
and
But I can’t find anything about how to prevent this ‘adverse affect’.
Copied my comment above from #2761 which appears to be the duplicate
Would be good to understand what causes the issue.
Same here with Synology DSM, running latest or 2 same issue.
But running image:
'jc21/nginx-proxy-manager:2.9.22'
fixed the issue for nowSame isue here;running inside proxmox lcx container. my docker compose:
Right, I also tried to install 2.10.1 to Synology 7.1.1, the result was same as before. Only 2.9.22 is the best way to me.
Same issue
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied) same ubuntu 22.x
Same problem running docker on Synology, with portainer and watchtower.
Have been on bridge network without problems before this update.
Reverted back to 2.9.22 and problem resolved.
I’ve got the same problem since the update
Problem still exists. Tried it with latest release on RouterOS 7.10.1. I have tried the following scenarios:
With v2.10.3, npm is now working perfectly again on my Synology. 🎉 I removed
from my env vars and that’s it.
I tested a fresh install and several server reboots and npm didn’t have any issues starting up anymore.
Thanks for the work on this @jc21 !
To avoid the error
s6-sudoc: fatal: unable to get exit status from server: Operation timed out
I added the lineto my docker run command.
With this line and without PUID and PGID it is working fine.
This problem has been solved in the v2.10.2 version, and I tested the docker container on CentOS and Debian without any problems.
Thanks to the developer for fixing this issue quickly.
PUID (Process User ID) and PGID (Process Group ID) so as you know they are environment variables used in Docker containers to set the user and group IDs for the container’s processes. They help to manage file and folder permissions for the data shared between the host system and the container - in this case the data folder and cert folder volume mounts for NPM.
I generally create a basic user with no login via the control panel in the Synology NAS that only has access to a volume for my docker containers. I create a user for each domain set of containers say user
docker-npm
, I think give this user ownership permissions to a docker-npm folder in the NAS where I want to mount volumes in the container.Once you create a new user, to get the User ID and Group ID on the NAS the easiest way is to create a Task from control panel and add the following command to the steps
cat /etc/passwd
you should then be able to manually run the task by hitting Run on the list of tasks and view the output (Action > View Result) which show you the user name you create along with the UID and GID.thanks for your fix it works and greatly appreciated!! Do you know what permissions this use would need for synology, is it worth creating a specific user for this, and would be keen to know the minimal permissions they would need to allow them to be used with the container?
2.9.22 works for me too but I noticed the versions latest, 2, or 2.10 creates files with UID=GID=911 while 2.9.22 use root user

If Semantic Versioning is respected, this shouldn’t be expected behaviour as this is a minor version not a major therefor it shouldn’t break compatibility.
Obviously backing up al configuration before changing versions is a good idea, as one could never have enough backups only too little hard drive space 😉
On Another note I see a bugfix version for 2.10 was issued 11 hours ago. But replies so far in this issue seem to indicate that is not a fix for this issue
I tried to test on CentOS 7 and Debian 10/11, this problem only happens on CentOS 7 system, not on Debian.
Maybe because of npmuser permissions, just guessing.
source: docker/rootfs/etc/s6-overlay/s6-rc.d/prepare/10-npmuser.sh
Same. Using podman on Rocky Linux.