Understand the default MongoDB configuration

Before running the commands shown on this page, you should load the Bitnami stack environment by executing the installdir/use_APPNAME script (Linux and MacOS) or by clicking the shortcut in the Start Menu under “Start -> Bitnami APPNAME Stack -> Application console” (Windows). On OS X VMs, the installation directory is /opt/bitnami and OS X VM users can click the “Open Terminal” button to run commands. Learn more about the Bitnami stack environment and about OS X VMs.

The MongoDB admin user for all databases is created during the Bitnami Stack installation process. The default configuration consists of:

  • The default data directory in Bitnami is located at installdir/mongodb/data.
  • A privileged account with a username of root. The root user has remote access to the database.

Check our recommendations for a production server.

MongoDB version

In order to see which MongoDB version are your machine running you can execute the following:

$ mongod --version

MongoDB configuration file

The MongoDB configuration file is located at installdir/mongodb/mongodb.conf.

The official MongoDB documentation has more details about how configure the MongoDB database.

MongoDB socket

On Unix, the MongoDB clients can connect to the server using a Unix socket file at installdir/mongodb/tmp/mongodb.sock.

Usually, when you use the MongoDB client tool included in the Stack, you will not need to specify the socket for the connection.

MongoDB port

The default port in which MongoDB listens is 27017.

MongoDB log file

The main MongoDB log file is at installdir/mongodb/log/mongodb.log.

Last modification April 8, 2020