Skip to main content

Connect to PostgreSQL addon

Overview

Apps on Cloudron use an internal PostgreSQL addon. Access the database from inside the server via an SSH tunnel for security.

This guide explains how to connect to the PostgreSQL addon from your local machine.

Database credentials

Get the database credentials:

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

Postgresql Addon Env

Internal IP address

The internal IP address of the PostgreSQL server is 172.18.30.2.

DB clients

CLI

Connect via PostgreSQL CLI:

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

DBeaver

DBeaver is a free multi-platform database tool for developers and database administrators.

Connect:

  1. Create a new PostgreSQL connection in DBeaver.
  2. Fill in the credentials from above:

Dbeaver Postgresql Connection

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

Dbeaver Postgresql Ssh Tunnel

You can now view the database:

Dbeaver Postgresql Tables