0

I want to make a chat app with django channels and I follow the steps from the docs. To enable the redis server you need to run docker run -p 6379:6379 -d redis:5 but when I run it I get:

0b941cd336fb1ac7728a24afa17fbe3cc896952a18f1f8ae2195a9baec3978f1
docker: Error response from daemon: driver failed programming external connectivity on endpoint hopeful_jemison (79963ac60fba80faeeaa0d1ad82375ece3e84361930ac90dec40f4ca6d0e5770): Bind for 0.0.0.0:6379 failed: port is already allocated.

What should I do?

Ivan Starostin
  • 8,798
  • 5
  • 21
  • 39
  • Hey Tasos! Welcome to SO! As the error message says, your `6379` port is already being used. You can have many containers running on *their* `6379` port but only one can be connected to your *host*'s `6379`. A good place to start debugging is `docker ps -a` to check if you have already a `redis` container up and running... – tgogos Jun 27 '22 at 12:33
  • ...or if you have a Redis instance running on your host outside a container that could also cause this conflict. You may not need the `-p` option at all if you're connecting through a Docker network (and you should), or else you need to change the first `-p` port number (but not the second). – David Maze Jun 27 '22 at 13:10

0 Answers0