All academies
Roadmap
LEVEL 2 · INSTALLATION & SETUP

Local install vs Atlas

8 min read

You can run MongoDB two ways: locally (Community Server on your machine or in Docker) or in the cloud with MongoDB Atlas, the managed service with a free tier. For learning, either works — this site gives you a third option: a full simulator right in your browser.

Docker (fastest local setup)

One command gives you a working server:

Terminal
docker run -d --name mongo -p 27017:27017 mongo:7

# then connect
docker exec -it mongo mongosh

Atlas free tier

1. Create an account at cloud.mongodb.com.

2. Create a free M0 cluster.

3. Add a database user and allow your IP in Network Access.

4. Copy the connection string: mongodb+srv://user:pass@cluster0.xxxxx.mongodb.net.

Try the Atlas simulator on this site to walk through the flow visually.

mongosh — the MongoDB Shell

mongosh is an interactive JavaScript shell. Everything you type in this site's shell simulator works the same way in real mongosh.

mongosh
mongosh "mongodb://localhost:27017"
test> use shop
shop> db.products.find()

Try it yourself

show dbs
Run in Shell

Check your understanding

Q1.

What is the default port MongoDB listens on?

Q2.

Which Atlas cluster tier is free?

Q3.

mongosh commands are written in JavaScript.