docker: Error response from daemon: Bind for [IP]:8080 failed: port is already allocated
TL;DRDocker cannot start the container because another process is already using TCP port 8080 on the host.
Most likely cause: A different Docker container or another program on the host is already listening on port 8080
Try first: Check which process is using port 8080 (ss -tlnp | grep 8080 (Linux) or netstat -ano | findstr :8080 (Windows))
Likely causes
- A different Docker container or another program on the host is already listening on port 8080most likely
- A previous container was not stopped cleanly and still holds the portpossible
How to fix it
Safest first: SafeChanges settingsDangerous
Check which process is using port 8080Safe
Run a command to list the program currently bound to port 8080.
ss -tlnp | grep 8080 (Linux) or netstat -ano | findstr :8080 (Windows)Stop the conflicting container or processChanges settings
If the output shows a Docker container, stop it with docker stop. If it is another program, close or reconfigure that program.
docker stop <container-name-or-id>Restart the original containerChanges settings
Run the docker run command again after freeing the port.
docker run ...
If that didn't fix it
Run 'docker ps -a' to list all containers and their published ports, then compare with the port shown in the error.
When to see a technician
If you are running this in a shared or production environment and cannot identify the conflicting service, ask your system administrator for help.
Quick answers
- What does docker: Error response from daemon: Bind for [IP]:8080 failed: port is already allocated mean?
- Docker cannot start the container because another process is already using TCP port 8080 on the host.
- What causes docker: Error response from daemon: Bind for [IP]:8080 failed: port is already allocated?
- A different Docker container or another program on the host is already listening on port 8080. (most likely) A previous container was not stopped cleanly and still holds the port. (possible)
- How do I fix docker: Error response from daemon: Bind for [IP]:8080 failed: port is already allocated?
- Try these in order, safest first: 1. Check which process is using port 8080. 2. Stop the conflicting container or process. 3. Restart the original container.
- What if that didn't fix it?
- Run 'docker ps -a' to list all containers and their published ports, then compare with the port shown in the error.
- When should I see a technician?
- If you are running this in a shared or production environment and cannot identify the conflicting service, ask your system administrator for help.
Related errors
codepermission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sockcodedocker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?codeError: Hydration failed because the initial UI does not match what was rendered on the servercodeFATAL: password authentication failed for user "postgres"codeCONFLICT (content): Merge conflict in src/app.js | Automatic merge failed; fix conflicts and then commit the result.codeFATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory