Docker Community Forums

Share and learn in the Docker community.

Compose up, port 80 is in use

Sorry I double post, but I also post this in Docker Hub, which I think its a mistake. So repost here
I am trying to install nginx proxy manager on ubuntu 20.04 the first time, so please bear with me.
I am getting the following error in reference to port 80 is in use. What can I do? My yaml is the standard yaml from github and I have -80:80 and -81:81 in my port statement. when I check the port port 80 is occupied by httpd owned by root. I was not able to kill the PIDs, because as soon as I do, it automatically reassign 4 different PID and the port is still in use. I am not running apache2.
BTW sudo kill -9 $(sudo lsof -t -i:80) does not work, it just come back.

sudo docker-compose up -d

Recreating nginxproxymanager_app_1 …
nginxproxymanager_db_1 is up-to-date
Recreating nginxproxymanager_app_1 … error

ERROR: for nginxproxymanager_app_1 Cannot start service app: driver failed programming external connectivity on endpoint nginxproxymanager_app_1 (096660274eb1b7db66a1c926fd8267ac11453b5867e5f93c0a3e22845bcf091b): Error starting userland proxy: listen tcp4 0.0.0.0:80: bind: address already in use

ERROR: for app Cannot start service app: driver failed programming external connectivity on endpoint nginxproxymanager_app_1 (096660274eb1b7db66a1c926fd8267ac11453b5867e5f93c0a3e22845bcf091b): Error starting userland proxy: listen tcp4 0.0.0.0:80: bind: address already in use
ERROR: Encountered errors while bringing up the project.

Version: 20.10.7
API version: 1.41
Go version: go1.13.15
Git commit: f0df350
Built: Wed Jun 2 11:56:38 2021
OS/Arch: linux/amd64
Context: default
Experimental: true

You have something on your host that already binds port 80.
This is rather an OS problem, than a docker problem.

Identify what webserver is running:

 curl -i http://localhost | grep Server

Then either configure it to not run on port 80 or remove it.

Nevermind, I found nextcloud is running in snap, it is not obvious. As soon as I stop nextcloud, port 80 opens up