Fix Docker error "bind: address already in use"
This error means the host port in -p HOST:CONTAINER is already taken.
Find who uses it
docker ps ss -ltnp | grep :8080
Fix options
- Stop the other container:
docker stop NAME. - Stop the other program using the port.
- Change the host side of the mapping:
docker run -p 8081:80 nginx
In Compose, edit ports: - "8081:80". The number after the colon is the port inside the container and usually should not change.