Connect to MongoDB addon
Overview
Reach the MongoDB addon through an SSH tunnel. The database is only reachable from inside the server.
This guide explains how to connect to the MongoDB addon from your local machine.
Database credentials
Get the database credentials:
- Open the Web terminal of an app.
- Run
env | grep CLOUDRON_MONGODB. - Note the credentials. Each app has its own separate database and credentials.

Internal IP address
The internal IP address of the MongoDB server is 172.18.30.3.
DB clients
CLI
Connect via MongoDB Shell:
- Open a Web Terminal.
- Click the
MongoDBbutton at the top to paste the connection command. - Press Enter to execute the command.
MongoDB Compass
MongoDB Compass is a GUI for visualizing schemas, monitoring performance, and querying data.
Connect:
- Create a new connection and click
Advanced Connection Options. - Fill in the server and authentication options from the credentials above:

Direct Connection
Check the Direct Connection checkbox. Compass cannot connect without this setting.

- Configure the SSH tunnel by clicking the Proxy/SSH tab:

You can now view the database:

Studio 3T
Studio 3T is a GUI client for MongoDB.
Connect:
- Create a new MongoDB connection via
File->Connect. - Select manual entry and fill in the credentials from above:


- Configure the SSH tunnel by clicking the SSH tab:

You can now view the database:
