Skip to content
Runbook

MongoDB

Document-oriented NoSQL database (BSON), designed for horizontal scalability and flexible schemas.

Databasenosqldocumentdatabasebson

Choose a platform

MongoDB at a glance

MongoDB stores documents in BSON format (a typed binary JSON) inside collections, with no rigid schema. It's a common choice for workloads where the data model evolves quickly, for native sharding and for replication.

The server daemon is mongod. The modern administration shell is mongosh (the old mongo shell, removed since version 6, should no longer be used). The default listening port is 27017.

Landmarks

  • Server: mongod, configured by a mongod.conf file (YAML format).
  • Data: a dedicated dbPath directory — its location depends on the platform and the package manager (see each page).
  • Backup / restore: mongodump and mongorestore, provided by the mongodb-database-tools package.

Security

By default, mongod starts without authentication and only listens on 127.0.0.1. The default bind is therefore localhost: the risk comes from deliberate exposure. Never expose port 27017 without having enabled security.authorization: enabled and restricted net.bindIp — many MongoDB instances exposed without authentication have been compromised at scale.

Choose your platform above for the exact commands.