nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Nginx (or another server) can’t listen on the port because another process already holds it — often Apache, another Nginx, or a stale master process.
Seen on:
Linux
Meaning
Only one process can bind a given IP:port. On fresh servers Apache is often pre-installed on port 80; a second nginx started by hand, a Docker container publishing 80, or an IPv6 listen duplicated in two server blocks causes the same message.
Common causes
- Apache/another web server running on the port
- Old nginx master process still running
- Docker container publishing the port
- Duplicate listen directives (e.g. listen [::]:80 twice)
⚡ Quick fix
- Find the owner: sudo ss -ltnp 'sport = :80'
- Stop/disable the other service
- Remove duplicate listen lines, then nginx -t
Detailed fix by platform
Linux
- bash
sudo ss -ltnp 'sport = :80' sudo systemctl disable --now apache2 sudo nginx -t && sudo systemctl restart nginx
How to diagnose
- Owner — PID/program on the port
- Config — grep -rn 'listen' /etc/nginx/
- Containers — docker ps --format '{{.Ports}}'
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in Linux
Other ways to find it
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 7 Oct 2026