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:
docker run -d --name mongo -p 27017:27017 mongo:7
# then connect
docker exec -it mongo mongoshAtlas 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 "mongodb://localhost:27017"
test> use shop
shop> db.products.find()