How to Access the Postgres Database on FusionPBX 5.3

bradgarrison

Member
Feb 20, 2023
46
9
8
49

Step 1: Retrieve Database Credentials from the FusionPBX server​

SSH into FusionPBX​

  1. Log in to your FusionPBX server via SSH.

Open the FusionPBX Configuration File​

Bash:
sudo nano /etc/fusionpbx/config.conf

Locate the following information in the file and make note of it:

Code:
database.0.port = 5432
database.0.name = fusionpbx
database.0.username = fusionpbx
database.0.password = ************

Step 2: Configure an SSH connection with Tunnel using PuTTY​

Download PuTTY​

  1. Download and install PuTTY from putty.org.

Configure the SSH Tunnel​

  1. Open PuTTY on your local workstation.
  2. In the PuTTY configuration window:
    • Enter your servers host name or IP, port number and name of the connection.
    • Navigate to the Connection category.
    • Expand SSH, then click on Tunnels.
  3. Set up the tunnel:
    • In the Source port field, enter 5432.
    • In the Destination field, enter localhost:5432.
    • Click the Add button to add the forwarded port.
  4. Connect to the FusionPBX server as you normally would using PuTTY.
  5. While connected via Putty, port 5432 from the FusionPBX server will be redirected to your local operating system.

Step 3: Connect to the Database Using DBeaver​

Download DBeaver​

  1. Download and install DBeaver from dbeaver.io.

Open DBeaver and Set Up the Connection​

  1. Open DBeaver.
  2. Press Shift + Ctrl + N to create a new database connection.
  3. Select PostgreSQL and click Next.

Enter Connection Details​

  1. Ensure the SSH tunnel is open and ports are mapped correctly.
  2. Configure the connection:
    • Host: localhost
    • Port: 5432
    • Database: postgres
    • Username: Use the username from config.conf (e.g., fusionpbx).
    • Password: Use the password from config.conf.
    • Check the box for Show all databases.
  3. Click Connect.

Verify the Connection​

  • If everything is configured correctly, you should now have access to the FusionPBX database.
This process allows you to securely access and manage your FusionPBX database using an SSH tunnel and a GUI database management tool like DBeaver without opening database ports to the Internet.

All the software listed in this tutorial is open source. Please remember to support your open-source communities.
 
  • Like
Reactions: voipBull