From the course: Databases for Node.js Developers

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Set up MongoDB

Set up MongoDB

From the course: Databases for Node.js Developers

Start my 1-month free trial

Set up MongoDB

- [Instructor] To get started with MongoDB, we first have to use Docker to download and run a container for it. Make sure that your Docker daemon is running. Here on my system, I can just click on this Docker icon in my taskbar and see that the desktop daemon's running. And then I will start in my terminal that I opened already by running docker pull mongo. This'll pull down the latest MongoDB image from Docker hub. Next, we have to start this container, and for that, I will now run docker run --name, that's the name of this container, and I will call it mongodb. And now I'm adding -p and then I add some port configuration. So I will explain this in a second. I now add 37017:27017. This tells Docker that it should map the internal default port of Mongo DB of 27017 to 37017. I'm doing that this way just to make sure that if you have Mongo DB already running on this system, that this does not collide. And then in the…

Contents