Home > Blockchain >  Connect to mongoDB Server which runs in a Docker container
Connect to mongoDB Server which runs in a Docker container

Time:11-11

I am trying to connect to MongoDB server which is running in a Docker container on my windows 10 machine. However when I try to connect to localhost:27017 I get an error. I wonder what am I missing?

enter image description here

enter image description here

I tried to connect to localhost:27017

CodePudding user response:

you need to expose the port of your docker container so something like docker run -p 27017:27017 ...

https://docs.docker.com/engine/reference/commandline/run/

  • Related