×


DBeaver installation on debian

Do you need to install DBeaver on Debian? This article will take you through the steps to get it installed on your Linux Server.


Here at Ibmi Media, as part of our Server Management Services, we regularly perform installation tasks on Debian and Ubuntu Linux distributions for our Customers.

In this context, we shall look into how to install DBeaver on Debian Server.

Facts about DBeaver

DBeaver is an open source free multi-platform database tool for developers, SQL programmers, database administrators and analysts.


As a multi-platform database tool, it supports any database having a JDBC driver. This signifies that it works with any Database.


Therefore popular relational databases such as MySQL, MariaDB, PostgreSQL, SQLite, Oracle, DB2, SQL Server, Sybase, Teradata, Netezza, and NoSQL databases( MongoDB, Cassandra, Redis, Apache Hive) are supported.

DBeaver's infrastructure is based on Eclipse platform with a robust workbench tool capable of building SQL queries, editing and transferring data, viewing trees of objects and even more.

The process of installing DBeaver on Debian 9/10 and Ubuntu 16.04/18.04/20.04

The following steps should be followed when trying to install DBeaver on Debian.

1. Java installation on Debian/Ubuntu

Start by installing Java and also set it as the default java on Debian 9/10. The java runtime is available on Debian repository as OpenJDK.
Install it by running the following command below;

sudo apt -y install default-jdk


After installing JDK, check the java version installed. Use the command below;

java -version


The output will look like this;

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)



For Ubuntu, install Java and set as default. Run the following command;

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


Now confirm the version installed with the command below;

java -version


You will see an output just like this;

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)


2. Add Debian repository and Install DBeaver CE

Use the following command to add DBeaver repository to your Debian or Ubuntu Server as per your case;

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


Next, update the apt list followed by installing DBeaver CE by running the command below;

sudo apt update
sudo apt -y install dbeaver-ce


Now confirm the version of DBeaver installed with the following command;

apt policy dbeaver-ce


You will get an output such as this;

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



3. Database Server Preparation

The next step is to create a database and user to enable your establish a connection before starting and configuring DBeaver.

i. MariaDB installation on Debian
To start, update the system with the commands below;

sudo apt -y update
sudo apt -y install software-properties-common gnupg2
sudo apt -y upgrade
sudo reboot


After rebooting successfully, log into your server on ssh and import the MariaDB gpg key and its repository with the following commands;

sudo apt-key adv –recv-keys –keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8

sudo add-apt-repository ‘deb [arch=amd64] http://mariadb.mirror.liquidtelecom.com/repo/10.4/debian buster main’


Next, install  MariaDB 10.4 on Debian 10 (Buster) by running the commands below;

sudo apt update
sudo apt install mariadb-server mariadb-client


Now secure MariaDB server which will help you set the root password as well as remove the test database and also disable remote root user login. Use the following command below;

sudo mysql_secure_installation


During this process , you will be prompted to answer some question just like stated below;

Enter current password for root (enter for none): Just press the Enter
Set root password? [Y/n]: Y
New password: Enter password
Re-enter new password: Repeat password
Remove anonymous users? [Y/n]: Y
Disallow root login remotely? [Y/n]: Y
Remove test database and access to it? [Y/n]: Y
Reload privilege tables now? [Y/n]: Y



Ensure that you enter a username and password as this is necessary to access MySQL console.


ii. MariaDB installation on Ubuntu
To install MariaDB 10.4 on Ubuntu, start by adding MariaDB repository to the system.

To begin, install software-properties-common if not installed with the following commands;

sudo apt update
sudo apt-get install software-properties-common


Next, make an importation of the MariaDB gpg key to add the Repository Key to the system by running the command below;

sudo apt-key adv –recv-keys –keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8


Now add the apt repository with the command below;

sudo add-apt-repository "deb [arch=amd64,arm64,ppc64el] http://mariadb.mirror.liquidtelecom.com/repo/10.4/ubuntu $(lsb_release -cs) main"


Now you can install MariaDB Server on Ubuntu by running the following commands;

sudo apt update
sudo apt -y install mariadb-server mariadb-client


Here you will be asked for the MariaDB root password which you should enter.
After entering your password, Press OK to continue with MariaDB installation.

In a case where you did not get a password prompt, you can set it manually with the following MySQL hardening script command;

sudo mysql_secure_installation


Now you will be prompted to answer some questions which will look like this;

Enter current password for root (enter for none): Just press the Enter
Set root password? [Y/n]: Y
New password: Enter password
Re-enter new password: Repeat password
Remove anonymous users? [Y/n]: Y
Disallow root login remotely? [Y/n]: Y
Remove test database and access to it? [Y/n]: Y
Reload privilege tables now? [Y/n]: Y


After the installation process is successfully completed, the service will start automatically.

You can check the status with the following command;

sudo systemctl status mysql


Now you can log into the MySQL shell with the command below as a root user and create a test database to enable you connect from the DBeaver Database tool just as shown below;

mysql -u root -p


You will see an output such as these;

Enter password:

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;



4. Launching DBeaver

To launch DBeaver, use your terminal or Applications Launcher in your Desktop Environment. Follow the steps below;

i. Start by creating a new database connection followed by Specifying the database type.
ii. Next, provide the database access information such as Server and database user.
iii. Now click "Test Connection" to confirm the connection. You will be asked to download the MariaDB connection driver. You are to agree by clicking the Download button.

You will see that the connection test is successful and a database will be created under the MariaDB connection profile. This will enable you to manage database, tables, Procedures, Views, Events and triggers via DBeaver.

Need support in installing Software on Ubuntu, Debian or CentOS? We are available to help you today.


Conclusion


This well documented article will guide you on how to install DBeaver on Debian and Ubuntu Server.