From charlesreid1

The short version: Just use docker. MongoDB authentication documentation is sloppy.


The brief summary:

  • MongoDB provides a nosql unstructured data store for arbitrarily complicated json structures
  • Listens on port 27017
  • Install from debian repos
  • Config handles file paths, logging, security, networking
  • Multiple ways to interface (command line shell in Javascript, or via language bindings)
  • Users must be created per-database, or a system-wide admin account added
  • Enable user access controls, expose to private management LAN interfaces


Native Installation

MongoDB/Manual Installation - installing MongoDB manually/natively on the OS

Docker Installation

To run MongoDB using Docker, I recommend using a docker-pod that has both MongoDB and MongoExpress (web frontend for MongoDB).


MongoDB/Docker - installing/running MongoDB in a docker pod


MongoDB/Configuration - notes on configuring MongoDB

MongoDB documentation on configuration:

Startup Service

MongoDB/Startup - notes on creating a MongoDB startup service

Access Control

MongoDB offers two access control mechanisms: user authentication, and network access.

First, MongoDB allows you to create an admin user, which can be used to create various user accounts with different permissions levels for different data. This provides a fine-grained access control mechanism around MongoDB.

MongoDB/Users - guide to setting up admin/regular users in MongoDB to control access to data in database

Second, like any network service, MongoDB can bind to a particular network interface, allowing the network firewall to be used to restrict access to MongoDB.

MongoDB/Network Access - guide to setting up the network to access (or not allow access) to MongoDB

Basic CRUD Operations

MongoDB performs CRUD (create, read, update, delete) transactions/operations on the data that it stores.


Basic Collections Operations

Basic operations on collections:


Basic Database Operations

Notes on basic database operations:



MongoDB as a Monitoring Target

MongoDB has several mechanisms for monitoring the state of the database (per second operations, cache sizes, disk and memory usage, etc.)

Utilities like Netdata and Collectd have plugins written for MongoDB that can collect this information as part of scraping the system status.

MongoDB as a Monitoring Data Store

collectd has a Write_MongoDB plugin to allow collectd to write its data to MongoDB.

Plugin link:


Python API: Pymongo

Java API: MongoDB/Java



Database design patterns:

Cheat sheet:

Related Page