Skip to content

How to connect DBeaver or CloudBeaver to PostgreSQL on a separate VM in Azure

DBeaverDevOps edited this page Jun 19, 2024 · 3 revisions

Table of contents

Connect your VM with CloudBeaver to PostgreSQL

Configure a peering for your networks

  1. Log in to your account in Microsoft Azure and go to Virtual networks.

Alt text

  1. Select the network that you created during the VM startup process.

Alt text

  1. Select Overview -> Capabilities -> Peerings and click Add peering.

Alt text

  1. The Add peering window will be opened.
  • In the Peering link name field add the name for the new peering.

  • In the Virtual network field select the network where your database is located (SQL-vpc in this case).

Alt text

  1. Click Create. The peering is configured.

Run CloudBeaver on the Linux VM and connect it to PostgreSQL

Step 1. Running CloudBeaver

  1. Connect to your Linux VM via SSH:

ssh -i ~/.ssh/<your_pub_key> <username>@<your_ip>

Alt text

  1. Check that your Linux VM has access to your SQL DB private IP.
  • Copy the private IP address of your database in Virtual machines -> Your SQL DB -> Properties -> Networking.

Alt text

  • Ping this IP in the terminal:

Alt text

If everything was done correctly in the previous steps, you will get the result as in the screenshot above. All that remains is to connect our CloudBeaver server to your database.

  1. Install Docker if it is not installed. Check this documentation for details.

  2. Run CloudBeaver with this command:

docker run -d --name cloudbeaver-ee --rm -ti -p 8080:8978 -v /var/cloudbeaver/workspace:/opt/cloudbeaver/workspace dbeaver/cloudbeaver-ee:latest

Alt text

You can learn more about CloudBeaver deployment in our documentation.

Step 2. Configure your network to access CloudBeaver

You need to make small changes to the network configuration so that you can access CloudBeaver UI.

  1. Go to Virtual machines -> Networking -> Inbound port rules -> Add inbound port rule

Alt text

  1. Add access to port 8080. For security reasons, we recommend specifying your IP or the IP of your proxy in the resource to avoid third-party access.

Alt text

  1. Open in browser http://<your_vm_ip>:8080

That's all done! You are in the CloudBeaver interface.

Step 3. Configure CloudBeaver and connect to PostgreSQL

  1. Enter your license key and configure your server.

Alt text

  1. Go to Connection Templates, click Add, and type your database name (PostgreSQL for example).

  2. In the Host field enter the IP address of your database you received earlier and indicate the authorization data for your database.

Alt text

  1. Click TEST to check that your configuration works.

Alt text

  1. Perfect! Now click CREATE in the top right. Connection to your database is added to CloudBeaver.

Alt text

Connect DBeaver from Win VM to PostgreSQL

  1. Connect to your Windows VM by using RDP.

  2. Check that your Linux VM has access to your SQL DB private IP.

  • Copy the private IP address of your database in Virtual machines -> Your SQL DB -> Properties -> Networking.

Alt text Alt text

  • Ping this IP in the terminal:

Alt text

If everything was done correctly in the previous steps, you will get the result as in the screenshot above. All that remains is to connect our DBeaver to your database.

  1. Add your license when starting the application.

  2. Create a new connection and choose your database (for example, PostgreSQL).

Alt text

  1. In the Host field, specify the Private IP address of your database and fill in other fields.

Alt text

Perfect! Your connection is ready.

Alt text

CloudBeaver Documentation

User Guide

Installation

Configuration

CloudBeaver AWS

CloudBeaver Enterprise Edition

Team Edition

Deployment

Clone this wiki locally