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