In this blog post, I’ll discuss how to install DBeaver Database Tool on Ubuntu 18.04 / Ubuntu 16.04 & Debian 10/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 on Ubuntu / Debian

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

sudo apt -y  install openjdk-11-jdk openjdk-11-jre

Confirm version:

$ java -version
openjdk version "11.0.5" 2019-10-15
OpenJDK Runtime Environment (build 11.0.5+10-post-Ubuntu-0ubuntu1.118.04)
OpenJDK 64-Bit Server VM (build 11.0.5+10-post-Ubuntu-0ubuntu1.118.04, mixed mode, sharing)
Install OpenJDK on Debian 10/9

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

sudo apt -y 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 
dbeaver-ce:
  Installed: 6.3.2
  Candidate: 6.3.2
  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 on Debian Linux

Install MariaDB on Ubuntu

You can also use MySQL

Install MySQL 8 on Debian Linux

Install MySQL 8 on Ubuntu

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)]> FLUSH PRIVILEGES;
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