For AI agents: a documentation index is available at https://www.mongodb.com/docs/llms.txt — markdown versions of all pages are available by appending .md to any URL path.
Docs Menu

Run the MongoDB Service with systemd

Linux distributions use systemd to start up and manage services through standard command-line tools. If you installed MongoDB Enterprise or MongoDB Community through the package manager, you can manage the mongod process through the systemctl command.

sudo systemctl <command> mongod
Command
Description

enable

Configures systemd to start the MongoDB service during boot.

restart

Restarts the MongoDB service.

start

Starts the MongoDB service.

status

Shows the status of the MongoDB service.

stop

Stops the MongoDB service.

On self-managed deployments, you can manage the mongod process with the systemctl command on any supported systemd-based distribution of Linux.

For details on supported platforms, see:

Most commands that run through systemd require a user with elevated privileges. While the root user can administer the mongod process directly through the systemctl command, other users must run these commands with sudo privileges.

When run through systemd with the default configuration, mongod logs messages through the system journal. The journal allows you to search for specific issues or messages with the journalctl command.

To start the MongoDB service, run the following command:

sudo systemctl start mongod

To show the status of the MongoDB service, run the following command:

systemctl status mongod
● mongod.service - High-performance, schema-free document-oriented database
Loaded: loaded (/lib/systemd/system/mongod.service; enabled;
vendor preset: enabled)
Active: active (running) since Mon 2026-09-21 09:41:13 UTC;
4 days ago
Docs: https://docs.mongodb.org/manual
Main PID: 8642 (mongod)
Memory: 148.1M
CPU: 2m 15s
CGroup: /system.slice/mongod.service
└─8642 /usr/bin/mongod --config /etc/mongod.conf

The status of the service is not privileged information. You do not need sudo to run the status command.

To stop the MongoDB service, run the following command:

sudo systemctl stop mongod

To restart the MongoDB service, run the following command:

sudo systemctl restart mongod

To configure the system to start the MongoDB service on startup, run the following command:

sudo systemctl enable mongod
Created symlink /etc/systemd/system/multi-user.target.wants/mongod.service → /usr/lib/systemd/system/mongod.service.

To show log messages sent by MongoDB to the system journal, run the following command:

sudo journalctl -u mongod
Sep 25 18:08:45 hostname systemd[1]: Started mongod.service - High-performance, schema-free document-oriented database.
Sep 25 18:08:46 hostname mongod[229981]: {"t":{"$date":"2026-09-25T18:08:46.214+00:00"},"s":"I", "c":"STORAGE", "id":4615611, "ctx":"initandlisten", "msg":"MongoDB starting", "attr":{"pid":229981,"port":27017,"dbPath":"/var/lib/mongo","architecture":"64-bit","host":"hostname"}}
Sep 25 18:08:46 hostname mongod[229981]: {"t":{"$date":"2026-09-25T18:08:46.214+00:00"},"s":"I", "c":"CONTROL", "id":51765, "ctx":"initandlisten", "msg":"Operating System", "attr":{"os":{"name":"Debian GNU/Linux 12 (bookworm)","version":"Kernel 6.1.0"}}}