

By default, it’s running without authentication. Of course, you probably want to tweak it a bit. You have a fully functional version of MongoDB running on your machine! (Here’s mine running, mapped to a different port). The first time may feel like npm install as multiple layers are downloaded, but subsequent runs should go quite fast. You can give the running container any name you like. The next step will pull the database image if it doesn’t already exist, then launch a running instance using the mounted volume.ĭocker run -name mongodb -v mongodata:/data/db -d -p 27017:27017 mongo If you skip this step, any changes you make will disappear when the container stops running. First, create a volume to persist data between runs. Now that the prerequisites are out of the way, there are two steps to getting MongoDB up and running.

I am running a Windows-specific version of desktop for community.

I assume you have Docker installed and are using Linux (not Windows) containers. Mongo maintains a set of official Docker images. Using containers, you can quickly get up and running with any number of predefined images and services. Note: although I’m focusing on Windows-based steps, the same steps should work fine on macOS and Linux.įortunately, this is precisely the type of scenario Docker was designed to address. There was just one catch: I had no desire to install MongoDB on my Windows 10 machine! The API for MongoDB is supported by Azure Cosmos DB and the demo illustrates how to migrate from a local instance of MongoDB for development purposes to a cloud-based production instance of Cosmos DB. If you aren’t familiar with MongoDB, it’s a very popular and mature document database.

Recently, I was working on a demo for an upcoming series of talks that required a (preferably local) instance of MongoDB.
