Skip to content
Demo (opens in a new tab)

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.

Get the database credentials:

  1. Open the Web terminal of an app.
  2. Run env | grep CLOUDRON_MONGODB.
  3. Note the credentials. Each app has its own separate database and credentials.

Mongodb Addon Env

The internal IP address of the MongoDB server is 172.18.30.3.

Connect via MongoDB Shell:

  1. Open a Web Terminal.
  2. Click the MongoDB button at the top to paste the connection command.
  3. Press Enter to execute the command.

MongoDB Compass is a GUI for visualizing schemas, monitoring performance, and querying data.

Connect:

  1. Create a new connection and click Advanced Connection Options.
  2. Fill in the server and authentication options from the credentials above:

Compass Mongodb General

Compass Mongodb Auth

  1. Configure the SSH tunnel by clicking the Proxy/SSH tab:

Compass Mongodb Ssh Tunnel

You can now view the database:

Compass Mongodb Collections

Studio 3T is a GUI client for MongoDB.

Connect:

  1. Create a new MongoDB connection via File -> Connect.
  2. Select manual entry and fill in the credentials from above:

Studio3t Mongodb Server

Studio3t Mongodb Auth

  1. Configure the SSH tunnel by clicking the SSH tab:

Studio3t Mongodb Ssh Tunnel

You can now view the database:

Studio3t Mongodb Collections