Connect to MongoDB Addon
Overview
Apps on Cloudron use an internal MongoDB addon. Access the database from inside the server via an SSH tunnel for security.
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.
To 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.
To 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:
