There is a new version of this tutorial available for Debian 12 (Bookworm).

Install Adminer Database Management Tool on Debian 10

Managing database systems like MySQL, PostgreSQL, Oracle, and SQLite form the web-based UI is easier than using the command-line tool. Adminer is one of the best full-featured database management tool written in PHP. It is very similar to phpMyAdmin that can be used to manage MySQL, SQLite, Oracle, PostgreSQL databases. Adminer is a simple and user-friendly database management tool compared to other tools.

Features

  • Multi-language support.
  • Supports various database systems including, MySQL, PostgreSQL, Oracle, Elasticsearch, MongoDB and many more.
  • Export and Import databases and tables.
  • Add, remove and modify databases and tables.
  • Run SQL queries from a text file.
  • Display and kill processes.
  • Extend the functionality using plugins.

In this tutorial, we will show you how to install the Adminer database management tool on Debian 10.

Prerequisites

  • A server running Debian 10.
  • A root password is configured on your server.

Getting Started

Before starting, it is recommended to update your server with the latest version using the following command:

apt-get update -y
apt-get upgrade -y

Once your server is updated, restart it to implement the changes.

Install LAMP Server

First, Adminer requires LAMP server installed in your server. You can install LAMP server using the following command:

apt-get install apache2 php libapache2-mod-php php-curl php-cli php-mysql php-gd mariadb-server -y

Once installed, start the Apache and MariaDB service and enable them to start after system reboot with the following command:

systemctl start apache2
systemctl start mariadb
systemctl enable apache2
systemctl enable mariadb

Once you are done, you can proceed to the next step.

Secure MariaDB Installation

By default, MariaDB is not secured. So you will need to secure it by running the mysql_secure_installation script.

mysql_secure_installation

Answer all questions as shown below:

Enter current password for root (enter for none): 
Set root password? [Y/n] Y
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

Once the MariaDB is secured, you will need to set the root password for MariaDB.

First, log in to MariaDB shell with the following command:

mysql

Next, set password for root user with the following command:

MariaDB [(none)]> SET PASSWORD FOR 'root'@'localhost' = PASSWORD("newpassword");

Next, flush the privileges and exit from the MariaDB shell with the following command:

MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit;

Once you are finished, you can proceed to the next step.

Install Adminer

By default, Adminer is not available in the Debian 10 default repository. So, you will need to download the Adminer installation file from their official website. You can download it to the Apache web root directory with the following command:

wget "http://www.adminer.org/latest.php" -O /var/www/html/adminer.php

Once the download is completed, change the permission of the downloaded file with the following command:

chown -R www-data:www-data /var/www/html/adminer.php
chmod 755 /var/www/html/adminer.php

Once you are done, you can proceed to the next step.

Access Adminer Dashboard

Now, open your web browser and type the URL http://your-server-ip/adminer.php. You will be redirected to the Adminer login page:

Adminer Login

Provide your MariaDB root username, password and click on the Login button. You should see the Adminer dashboard in the following page:

Adminer Database Management Tool

Now, click on the localhost button on the top screen, you should see the following page:

Select database

Now, click on the "Create Database" button. You should see the following page:

Create Database

Now, provide the database name you want to create and click on the Save button to create the database as shown below:

Newly Created database in Adminer

Enable SSL for Adminer and get a free SSL Certificate from Let's Encrypt

The first step to secure Adminer with a Let's Encrypt SSL Certificate is to install the python3-certbot-apache package. Run the following command:

apt-get -y install python3-certbot-apache

In the next step we request an SSL certificate from Let's Encrypt by using the certbot client program. During this process the Let's Encrypt server tries to connect to your server using the domain name you provide to the certbot command. It is important that this domain name already points to your server in the DNS, so that the website is already reachable via its domain name on port 80 (http). If the website is not accessible from the Internet, the creation of the Let's Encrypt SSL certificate will fail.

Before we can start creating the SSL certificate, we need to set the domain name in the vhost configuration file. Open the default vhost file with an editor:

nano /etc/apache2/sites-available/000-default.conf

and add the line:

ServerName example.com

Right below the 'DocumentRoot' line. Replace example.com with the domain name of your own website.

Then create the SSL Certificate with this command:

certbot --apache -d example.com

Replace example.com with your domain name here again. The command will start a wizard that asks you several questions.

Enter the email address where the administrator who is responsible for this website can be reached.

Set Email address

Accept the terms and conditions of the Let's Encrypt SSL authority.

Accept terms and conditions

Certbot will ask you now if you like to share your email address with the Electronic Frontier Foundation. Choose here whatever you prefer.

Email address FSF

Then choose if you want to redirect non-SSL requests to https:// automatically. I'll select yes here to avoid duplicate content problems when the website is available as http:// and https:// version.

Redirect HTTP requests

The SSL certificate has been issued successfully.

SSL cert issued successfully

When you access the website now with a browser, you will get redirected automatically to SSL and the green padlock in front of the URL bar in the browser shows that we are using a trusted SSL certificate now.

Conclusion

In the above tutorial, you learned how to install Adminer on Debian 10 server. You can now manage your database easily with Adminer web-based interface. Feel free to ask me if you have any questions.

Share this page:

3 Comment(s)