mongod
MongoDB database server daemon
TLDR
Start MongoDB server
$ mongod
Specify data directory$ mongod --dbpath [/data/db]
Specify port$ mongod --port [27017]
Bind to all interfaces$ mongod --bind_ip_all
Enable authentication$ mongod --auth
Use config file$ mongod --config [/etc/mongod.conf]
Run as replica set$ mongod --replSet [rs0]
Run as a daemon with logging$ mongod --fork --logpath [/var/log/mongod.log]
SYNOPSIS
mongod [options]
DESCRIPTION
mongod is the MongoDB database server daemon. It handles data requests, manages data storage, and performs background management operations.The tool is the core database process. Supports replication, sharding, and authentication. Uses the WiredTiger storage engine by default.
PARAMETERS
-f, --config FILE
Configuration file path.--dbpath PATH
Database directory path (default: /data/db).--port PORT
Listening port number (default: 27017).--bind_ip IP
Comma-separated list of IP addresses to bind.--bind_ip_all
Bind to all IP addresses.--auth
Enable authentication.--replSet NAME
Replica set name.--logpath FILE
Path for the log file. Required when using --fork.--fork
Run the server as a background daemon.--keyFile FILE
Path to shared key file for replica set/sharded cluster authentication. Implies --auth.--wiredTigerCacheSizeGB SIZE
Maximum size of the WiredTiger internal cache in GB.--help
Display help information.
CAVEATS
Requires proper storage configuration. Resource intensive. Needs careful security setup. When using --fork, --logpath must also be specified.
HISTORY
mongod is the MongoDB server process, the core component of MongoDB since its initial release in 2009.
SEE ALSO
mongosh(1), mongo(1), mongoimport(1), mongodump(1), mongorestore(1)
