(Last Updated On: June 25, 2019)

In this blog post, I’ll discuss how to install DBeaver Database Tool on Ubuntu 18.04 / Ubuntu 16.04 / Debian 9. DBeaver  CE is a free and open source multi-platform database management tool/SQL client designed for Developers,  SQL programmers, Analysts, and Database administrators.

DBeaver supports any database which has JDBC driver – MySQL/MariaDB, PostgreSQL, Oracle, DB2 LUW, Google BigQuery, Exasol, SQL Server, Sybase/SAP ASE, SQLite, Firebird, H2, HSQLDB, Derby, Teradata, Vertica, Netezza, Informix, etc. If you need support for non-JDBC data sources such as WMI, MongoDB, Cassandra, Redis, then consider using DBeaver Enterprise Edition.

DBeaver is based on Eclipse platform and is a good workbench tool for building SQL queries, editing, and transferring data, viewing trees of objects, completing database administration tasks, monitoring database connection sessions, and a lot more.

Follow steps below to Install DBeaver on Ubuntu 18.04 / Ubuntu 16.04 / Debian 9.

Step 1: Install Java

Run the following commands to have Java installed and set as default Java on your Ubuntu 18.04 / Ubuntu 16.04.

Starting from DBeaver,5.3.1 support for Java 11 was added, You can install Java 11 using our previous guide.

How to Install Java 11 on Ubuntu 18.04 /16.04 / Debian 9

If you installed Java 11, the version output should be similar to below:

$ java -version
java version "11.0.1" 2018-10-16 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.1+13-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.1+13-LTS, mixed mode)

If you prefer to stick with Java 8, then the installation for it is covered below.

sudo add-apt-repository ppa:webupd8team/java
sudo apt update
sudo apt install oracle-java8-set-default

Agree to License

Then Agree to Accept the Oracle Binary Code license terms.

Confirm version:

$ java -version
java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)
Install OpenJDK 8 on Debian 9

OpenJDK is the default Java development and runtime available on Debian 9 repository. Install it by running the command below:

sudo apt install default-jdk

Check Java Version:

$ java -version
openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-2~deb9u1-b13)
OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)

Step 2: Add Debian repository and Install DBeaver CE:

Add DBeaver repository to your Debian / Ubuntu by running the commands below:

wget -O - https://dbeaver.io/debs/dbeaver.gpg.key | sudo apt-key add -
echo "deb https://dbeaver.io/debs/dbeaver-ce /" | sudo tee /etc/apt/sources.list.d/dbeaver.list

After adding the repo, update the apt list and install DBeaver CE

sudo apt update
sudo apt -y  install dbeaver-ce

Install DBeaver version can be checked using:

$ apt policy  dbeaver-ce 
  Installed: 6.0.4
  Candidate: 6.0.4
  Version table:
 *** 5.3.1 500
        500 https://dbeaver.io/debs/dbeaver-ce  Packages
        100 /var/lib/dpkg/status

Step 3: Prepare Database Server

Before launching and configuring DBeaver service, you may first need to create a database and database user to connect to. For this demonstration, I’ll use the MariaDB database server.

You can install MariaDB Database server by using our previous guides below.

Install MariaDB 10.3 on Ubuntu 18.04 and CentOS 7

How to Install MariaDB 10.3 on Debian 9 / Debian 8

How to install MariaDB 10.3 on Ubuntu 16.04 (Xenial Xerus) LTS

You can also use MySQL

How to Install MySQL 8.0 on Debian 9 / Debian 8

How to install MySQL 8.0 on Fedora 29 / Fedora 28

How to Install MySQL 8.0 on Ubuntu 18.04 / 16.04

Once you have a database server, log in to MySQL shell as root user and create a test database to connect from DBeaver Database tool.

$ mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 48
Server version: 10.3.11-MariaDB-1:10.3.11+maria~bionic-log mariadb.org binary distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> CREATE DATABASE test_db;
MariaDB [(none)]> CREATE USER 'test_user'@'localhost' IDENTIFIED BY 'StrongPassword';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON test_db.* TO 'test_user'@'localhost';
MariaDB [(none)]> QUIT;

Step 4: Launching DBeaver

You can either Launch DBeaver from your terminal or Applications Launcher for your Desktop Environment.

1. Create a new database connection – Specify database type.

2. Provide database access details – Server, database user

3. Click “Test Connection” to verify the connection. When asked to download mariadb connection driver, please agree by clicking Download button.

Your connection test should then return a success.

You should now see database created earlier under MariaDB connection profile.

You can now manage your database, tables, triggers, Procedures, Views, Events e.t.c using DBeaver.

That’s all. Enjoy using SQL editor provided by DBeaver to generate and test SQL queries on a GUI as opposed to CLI.

Also check:

How to Install Redash Data Visualization Dashboard on Ubuntu 18.04 LTS

Install mycli MySQL client AutoCompletion on Ubuntu 18.04 LTS