Please note that these documents apply to OpenShift Online v2 only (accounts created before August 1st, 2016).
If you are using one of the OpenShift 3 products, please refer to documents available at

Using MongoDB with OpenShift Online

The mongodb cartridge provides MongoDB on OpenShift. MongoDB is a document-oriented NoSQL database, using JSON-style documents with dynamic schemas. With OpenShift you can easily deploy and run applications backed by MongoDB using your favorite servers and frameworks. OpenShift Online currently supports MongoDB 2.4.

The MongoDB Cartridge

Environment Variables

The mongodb cartridge provides several environment variables to reference for ease of use:

Variable Description


The MongoDB IP address


The MongoDB port


The MongoDB username


The MongoDB password


The MongoDB connection URL (e.g. mongodb://<username>:<password>@<hostname>:<port>/)


The path to the MongoDB log directory

Example Use

Getting a Python app with a MongoDB backend deployed onto OpenShift is as easy as executing two commands:

$ rhc app create MyApp python-3.3
$ rhc cartridge add mongodb-2.4 -a MyApp

These two commands create your "server" and install and configure Python, MongoDB, and a git repository on the server. You can now visit your application on the web at:


The rockmongo cartridge provides RockMongo on OpenShift. In order to add this cartridge to an application, the MongoDB cartridge must already be present. Once installed, RockMongo can be used by navigating to with the MongoDB login credentials.