When I run docker-compose up
in my Docker project it failes with the following message:
Error starting userland proxy: listen tcp 0.0.0.0:3000: bind: address already in use
netstat -pna | grep 3000
shows this:
tcp 0 0 0.0.0.0:3000 0.0.0.0:* LISTEN -
I've already tried docker-compose down
, but it doesn't help.
This helped me:
and then:
kill -9 <process id>
(macOS) orsudo kill <process id>
(Linux).Source: comment by user Rub21.
I had the same problem. I fixed this by stopping the Apache2 service on my host.
In my case it was
And all that I need is turn off debug listening in php storm
In your case it was some other process that was using the port and as indicated in the comments,
sudo netstat -pna | grep 3000
helped you in solving the problem.While in other cases (I myself encountered it many times) it mostly is the same container running at some other instance. In that case
docker ps
was very helpful as often I left the same containers running in other directories and then tried running again at other places, where same container names were used.How
docker ps
helped me:docker rm -f $(docker ps -aq)
is a short command which I use to remove all containers.Edit: Added how
docker ps
helped me.Check
docker-compose.yml
, it might be the case that the port is specified twice.and then restart your computer