← Back to all fixes
Port is already in use when starting container
The Issue
`docker run -p 3000:3000 myapp` fails: `Bind for 0.0.0.0:3000 failed: port is already allocated`
Root Cause
Another process (or another container) is already listening on host port 3000.
How to Fix
Find what is using the port: `sudo ss -tlnp | grep 3000` or `lsof -i :3000`Stop the conflicting process or containerOr map to a different host port: `docker run -p 3001:3000 myapp` (host:container)List running containers and their ports: `docker ps --format "table {{.Names}} {{.Ports}}"`