Home

How to connect to a remote database using DBeaver via SSH (GUI Tool)

DBeaver is an awesome SQL client and database management tool.

It comes with drivers for the most popular databases, including MySQL, PostgreSQL, SQLite and many others, meaning you can learn one tool and use it across projects built on different technology stacks. How awesome is that?

Bellow are the steps you can use to connect your DBeaver client to a remote database server via SSH.

Note that you only need to do these steps once. The connection configurations will be saved and you can re-use them by right-click + connect.

This guide is created using DBeaver version 6.3.

Method 1: DBeaver via SSH with plain password

1. Create a new connection

Create a new connection by right clicking in your Database Navigator area.

Create a new connection
Creating a new connection

2. Fill SSH details

Fill details under the SSH tab, and click Test tunnel configuration.

Adding SSH details
SSH details

You should see a success message if the details were correct.

3. Fill database’s details

Now that DBeaver can connect via SSH, let’s go back to the General tab and fill in the database credentials:

Adding database details
Database details

Clicking Test Connection, you should see a success message. Click Finish.

Method 2: DBeaver with encrypted openssh private key file

If your server requires an openssh private key to login, follow the bellow steps:

1. Add SSHJ to DBeaver

You can do it by opening Help/Install New Software… and typing the following link: https://dbeaver.io/update/sshj/latest/

Opening installer
Open installer
Installing SSHJ from URL
Installing SSHJ from URL

2. Connect

Use the same steps as Method 1, but adjust as follows:

  1. On the SSH details menu (step 2), provide the password for your encrypted private key file.
  2. Select SSHJ, under Implementation.

    Providing private key password
    Providing private key password
  3. Change Authentication Method to Public Key.
  4. Select your Private Key

    Select Private Key
    Select Private Key
  5. Click Test tunnel configuration and Finish.

Resources

If you need additional help, this link may be very useful.