`docker compose up` error: `Bind for 0.0.0.0:80 failed: port is already allocated` while nothing seems to listen.
IntermediateTroubleshootingNetworking, DNS and Compose
Answer
Likely causes → A stale docker-proxy or a stopped container still holding the mapping, or another Compose project.
Diagnose →
docker ps -a --filter publish=80
sudo ss -tlnp | grep ':80 '
ps aux | grep docker-proxy
Fix → Remove the old container (docker rm -f), docker compose down --remove-orphans, restart Docker if the proxy is orphaned.
Prevent → Use --remove-orphans.
More on Networking, DNS and Compose
`curl: (7) Failed to connect to localhost port 8080: Connection refused` after `docker run -p 8080:80 nginx`.Beginner`Bind for 0.0.0.0:5432 failed: port is already allocated`BeginnerContainers cannot reach the internet: `Temporary failure in name resolution`Advanced`ping` works to IPs but DNS names fail on the default bridge: `ping: bad address 'db'`Beginner`getaddrinfo ENOTFOUND db` in a Compose app.BeginnerCompose: `service "api" depends on undefined service "db"`Beginner