Docker Diagnostic

Fix Docker Error: "Bind for 0.0.0.0:3000 failed: port is already allocated"

Docker cannot bind a host port because another local process (such as a local Node server, Postgres instance, or orphaned Docker container) is already listening on that port.

Bind for 0.0.0.0:port failed: port is already allocated

Quick Fix Checklist

  1. Find the PID using the port: lsof -i :<PORT> (macOS/Linux) or netstat -ano | findstr :<PORT> (Windows)
  2. Kill the blocking process: kill -9 <PID>
  3. Check for running Docker containers: docker ps
  4. Stop running container: docker stop <container-id>
  5. Prune stopped containers: docker container prune -f