I’m trying to run an Nginx container on my server using the following command:
docker run -d -p 80:80 nginx
But I keep getting this error:
docker: Error response from daemon: driver failed programming external connectivity on endpoint <container_id>:
Bind for 0.0.0.0:80 failed: port is already allocated.
How can I find out what’s causing this and free up the port so I can run my container?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hi there,
That error means something is already using port 80 on your system. You can check which process is using it with:
or
If it’s Nginx or Apache, you can stop it:
If you don’t want to stop the service, run your container on a different port, like this:
Then access it at
http://localhost:8080
.Let me know if you’re still stuck! 🚀
- Bobby