The port you are trying to bind is already used by another process or container. Find and stop the conflicting process, or use a different port mapping.
This error occurs when Docker tries to bind a container port to a host port that is already in use. Each port on a host can only be bound by one process at a time. The "userland proxy" mentioned in the error is Docker port forwarding mechanism that listens on the host and forwards traffic to containers. When another process (or container) already occupies that port, Docker cannot start the proxy.
Identify the process currently binding the port:
# On Linux/macOS
sudo lsof -i :3000
# Or using netstat
sudo netstat -tlnp | grep 3000
# On Windows
netstat -ano | findstr :3000This shows the process ID (PID) and name using the port.
See if another container is using the port:
# List all containers (including stopped)
docker ps -a
# Check port mappings specifically
docker ps --format "table {{.Names}} {{.Ports}}"If you find a container using the port, stop or remove it.
If another container is using the port:
# Stop the container
docker stop <container_name_or_id>
# Or remove it entirely
docker rm -f <container_name_or_id>For Docker Compose projects:
docker-compose downIf a host process is using the port:
# Stop by process name
sudo systemctl stop nginx # or apache2, etc.
# Or kill by PID
sudo kill <PID>
# Force kill if necessary
sudo kill -9 <PID>Consider whether you need that service running.
If you cannot free the port, map to a different host port:
# Change host port (first number), keep container port
docker run -p 3001:3000 myimage
# In docker-compose.yml
ports:
- "3001:3000"Update any application configuration to use the new port.
Sometimes containers get stuck. Force cleanup:
# Remove all stopped containers
docker container prune
# Restart Docker daemon (releases all ports)
sudo systemctl restart dockerDocker Compose Port Conflicts: When running multiple Compose projects, use unique port mappings or define them via environment variables in your .env file.
Disable Userland Proxy: For better performance and to use iptables directly, add "userland-proxy": false to /etc/docker/daemon.json. Note: this may cause issues with some network configurations.
macOS/Windows: Check Docker Desktop port forwarding is not conflicting with host services. VPNs can sometimes cause port conflicts.
image operating system "linux" cannot be used on this platform
How to fix 'image operating system linux cannot be used on this platform' in Docker
manifest unknown: manifest unknown
How to fix 'manifest unknown' in Docker
cannot open '/etc/passwd': Permission denied
How to fix 'cannot open: Permission denied' in Docker
Error response from daemon: failed to create the ipvlan port
How to fix 'failed to create the ipvlan port' in Docker
toomanyrequests: Rate exceeded for anonymous users
How to fix 'Rate exceeded for anonymous users' in Docker Hub