Understand the default MongoDB configuration

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 /opt/bitnami/mongodb/data/db.
  • A privileged account with a username of root. The root user has remote access to the database.

MongoDB version

In order to see which MongoDB version your system is running, execute the following command:

$ mongod --version

MongoDB configuration file

The MongoDB configuration file is located at /opt/bitnami/mongodb/conf/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 /opt/bitnami/mongodb/tmp/mongodb-27017.sock. The name of the file includes the port number: 27017.

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 on which MongoDB listens is 27017. This port cannot be accessed remotely over the public IP address of the database host. For security reasons, we do not recommend making the MongoDB port accessible over a public IP address. If you must make it accessible over a public IP address, we recommend restricting access to a trusted list of source IP addresses using firewall rules. Refer to the FAQ for information on opening ports in the server firewall.

MongoDB Process Identification Number

The MongoDB .pid file allows other programs to find out the PID (Process Identification Number) of a running script. Find it at /opt/bitnami/mongodb/tmp/

MongoDB storage engine

The default configuration uses the WiredTiger storage engine, with a default cache size equal to 50% of (RAM - 1 GB). The cache size can be adjusted through the storage.wiredTiger.engineConfig.cacheSizeGB configuration parameter, although care should be taken to avoid increasing the cache size above its default value. Read more about the WiredTiger storage engine.

MongoDB log file

The main MongoDB log file is at /opt/bitnami/mongodb/logs/mongodb.log.

MongoDB key file

Find the security options in the key file located at /opt/bitnami/mongodb/conf/keyfile.

Last modification September 25, 2018