Common causes
- Another container or service is already using the port defined in the Compose file
- A previous docker-compose up left containers running that weren't cleaned up
- A local development server or system service is bound to the same port
- Two services in the same Compose file are both mapped to the same host port
How to fix it
- Stop all running Compose services first: docker-compose down
- Find what's using the port: lsof -i :PORT or netstat -tulpn | grep PORT
- Change the host port in docker-compose.yml: ports: - "8081:80" instead of "8080:80"
- Stop the conflicting local service, then re-run docker-compose up
Example
$ docker-compose up
ERROR: for nginx: Cannot start service nginx: driver failed programming external connectivity on endpoint: Error starting userland proxy: listen tcp4 0.0.0.0:80: bind: address already in usePort 80 is already in use by a local web server, preventing Docker Compose from binding to it
Browse more errors
The Developer Hub covers 150+ errors across Git, npm, Node.js, Python, TypeScript, and Docker — with plain-English explanations and fix steps.
