port is already allocated 🐳 Docker

Docker: Bind for 0.0.0.0:80 failed: port is already allocated

Another container or host process already publishes that host port.

Seen on: Docker

Meaning

Two things can’t bind the same host port. Often an old container from a previous docker run/compose project is still running.

Common causes

  • Old container still running
  • Another compose project uses the same port
  • Host service (nginx, apache, postgres) on that port

⚡ Quick fix

  1. docker ps and stop the container using the port
  2. Change the host side of the mapping (8080:80)
  3. Stop the host service or pick another port

Detailed fix by platform

Docker

  1. docker ps --filter publish=80 finds containers publishing port 80.

How to diagnose

  1. Containers — Which container publishes the port?
  2. Host — Is a host process listening?

🧠 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.