Fix "Port Is Already Allocated" on Coolify Redeploys
Error: Bind for 0.0.0.0:3000 failed: port is already allocated
Docker refuses to start the new container because the host port it needs is still held by another container, so the redeploy fails at the bind step.
During a rolling/recreate deploy, Docker sometimes doesn't fully remove the old container before the new one tries to bind the same host port, leaving an orphaned container holding it. The same error also shows up when a manually-mapped port collides with another service also bound to 0.0.0.0 — Coolify's default port publishing binds to all interfaces (0.0.0.0) rather than just localhost, so two unrelated services mapped to the same host port fight over it.
The fix
List all containers on the server to find the one still holding the port.
docker ps -aRemove the orphaned container once you've identified it.
docker rm -f <container-id>Check the app's port mapping under Configuration > Network for a conflict with another service on the same host port.
If an orphaned proxy process is holding the port with no visible container, restart the Docker daemon to clear it.
Where possible, avoid publishing app ports directly to the host at all — let Traefik route to the container instead, since that's Coolify's normal path and avoids host-port collisions entirely.
Verify it worked
The redeploy completes without the error, and docker ps shows exactly one container for the app.
docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"Related Coolify errors
- Timeout / no response / container not starting
- no available server (Traefik 503) behind your Coolify domain after a successful deploy
- 502 Bad Gateway (Traefik) — build succeeds and container runs, but your-domain.com returns 502 Bad Gateway
- Healthcheck failed / Container is unhealthy — new container never receives traffic, deploy rolls back to the old container (or shows 404 "No available server")
Sources
- github.com/coollabsio/coolify/issues/1573
- github.com/coollabsio/coolify/issues/2547
- github.com/coollabsio/coolify/issues/4749