Connecting to MongoDB

Aptible Deploy MongoDB Databases require authentication and SSL to connect.



MongoDB databases use a valid certificate for their host, so you're encouraged to verify the certificate when connecting.

Connecting to the admin database

There are two MongoDB databases you might want to connect to:

  • The admin database.
  • The db database created by Aptible Deploy automatically.

The username (aptible) and password for both databases are the same. However, the users in MongoDB are different (i.e. there is a aptible user in the admin database, and a separate aptible user in the db database, which simply happens to have the same password).

This means that if you'd like to connect to the admin database, you need to make sure to select that one as your authentication database when connecting: connecting to db and running use admin will not work.


Replica set clustering is available for MongoDB. Replicas can be created using the aptible db:replicate command.

Data Integrity and Durability

On Aptible Deploy, MongoDB is configured with default settings for journaling. For MongoDB 3.x instances, this means journaling is enabled. If you use the appropriate write concern (j=1) when writing to MongoDB, you are guaranteed that committed transactions were written to disk.


Configuration of MongoDB command line options is not supported on Aptible Deploy.

MongoDB Databases on Aptible Deploy autotune their Wired Tiger cache size based on the size of their container based upon Mongo's recommendation. See the image's public git repo for details.

Connection Security

Aptible Deploy MongoDB Databases support connections via the following protocols:

  • For Mongo versions 2.6, 3.4, and 3.6: TLSv1.0, TLSv1.1, TLSv1.2
  • For Mongo version 4.0: TLSv1.1, TLSv1.2

Did this page help you?