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.
See how MongoDB 9.0 delivers up to 2x higher throughput.
MongoDB Branding Shape
Register now >
Docs Menu

Default Data and Log Directory Paths

MongoDB Enterprise and Community packages ship with a configuration file that sets the default directories for data and logging. This configuration file is loaded by default when you start mongod as a service.

By default on Linux, MongoDB runs using the mongod user account. If you change the user that runs the MongoDB process, you must also modify the permissions to the data and log directories to give this user access to these directories.

Official MongoDB packages include a configuration file.

These settings, such as the data directory and log directory specifications, take effect upon startup. That is, if you change the configuration file while the MongoDB instance is running, you must restart the instance for the changes to take effect.

Select your operating system to view the default directories for MongoDB.