"failed to bind host port"

Hi everyone,

I’ve made a fresh installation with Ubuntu Server 24.04.3 LTS in order to test Seafile.

After that, I installed Docker (“Install Docker Engine on Ubuntu” from docs.docker).

And then, I installed Seafile (with the “Setup Community Edition - Seafile Admin Manuel” guide).

But, on the last step (I listened before on :80 and nothing at all):

docker compose up -d

I have this error:

Error response from daemon: failed to set up container networking: driver failed programming external connectivity on endpoint seafile-caddy (90f5b89ddcc4293e742278d35d7633d785e0535f7c11971106fe4557a6eabf3e): failed to bind host port for 0.0.0.0:80:172.19.0.3:80/tcp: address already in use

I rebooted but it stills then I stopped / resarted Docker and it stills.

So I ran :

sudo ss -tulpn | grep :80

And I get :

tcp   LISTEN 0      511                                    *:80              *:*    users:(("httpd",pid=16639,fd=4),("httpd",pid=2627,fd=4),("httpd",pid=2626,fd=4),("httpd",pid=2625,fd=4),("httpd",pid=2624,fd=4))

I tried to stop it :

sudo systemctl stop httpd

But “Failed to stop httpd.service: Unit httpd.service not loaded.” …

I tried to stop apache2 > same result.

I don’t understand what this ghost HTTPD is.

Someone can help me ?

I am not a pro but i had this error this day and i repaired it with :

sudo systemctl stop nginx

and restarted Docker.

A tried the same thing but it still not working at all :frowning:

I think what you need is to find out what is starting httpd. Since stopping the service isn’t killing it, there is either another service name for it, or it is being started by another program and rather than a service. Here’s a few things that can help you track it down.

The easiest first step, use pstree to see what the program’s parent and child processes are. You found the pid is 16639, so lets get details of that (you will need to get the current pid if it might have changed, like if you rebooted).

pstree -Ssp 16639

You can also leave the pid off to see everything (but that can be a lot). On my reverse proxy doing that to look at nginx processes looks like:

$ pstree -Ssp 27432
systemd(1)───nginx(27432)─┬─nginx(27433)
                          └─nginx(27434)

This tells us that ningx has started some child processes (also nginx), and has as its parent “systemd(1)”. That means it was either started by systemd (as a service for example), or was started by a program that closed but left the child running (the child then gets adopted by the grandparent). If you see “systemd – docker – httpd” then you know this isn’t running as a service, but was started by docker for some reason.

For more details, we need the top-most pid of the httpd tree from pstree. For example if I had searched pstree for 27434 in my example above I would see that the top nginx is pid 27432, and that’s the one to use in this step. We will simply ask systemd for the status of this process. If this process is from a systemd service, it will give us the status of that service, and we will get to see its name.

$ systemctl status 27432
 nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; preset: enabled)
     Active: active (running) since Tue 2025-08-19 01:45:33 MDT; 3 days ago
...

In my case it tells us that the service is nginx.service, so I now know which one to stop.

I hope that helps.