How to install Adminer on Ubuntu 20.04 LTS

How do I install Adminer on Ubuntu 20.04 LTS for database management over the web?

Adminer (formerly known as phpMinAdmin) is an open-source and free web-based database management tool. It is written in PHP. As compared to phpMyAdmin, it is a lightweight application with strong security and user experience in mind. This tutorial describes how to install Adminer on Ubuntu 20.04 LTS Linux server for MySQL or MariaDB.
Tutorial requirements
RequirementsUbuntu Linux and Apache 2 with PHP
Root privileges Yes
Difficulty Easy
Est. reading time 10m

Procedure to install Adminer on Ubuntu 20.04 Linux server

  1. Update your Ubuntu server running sudo apt update && sudo apt upgrade
  2. Make sure Apache server installed and configured on Ubuntu
  3. Install Adminer by typing the sudo apt install adminer command.
  4. Enable configuration, run: sudo a2enconf adminer
  5. Log in and start accessing database using https://your-domain/adminer/ URL.

Obviously, you need Apache or any other web server installed. Here is how to install Apache 2 on Ubuntu 20.04 LTS. Now that Apache web server installed and running let us get our hands dirty by installing Adminer.

Installing Adminer

First update the system using the apt command/apt-get command and then install Adminer software:
sudo apt update
sudo apt upgrade
sudo apt install adminer

Please note that apart from Apache PHP required to run Adminer. Hence, apt installed PHP and automatically configured it too. For other web servers, you need to perform manual configurations. Use the cat command to verify that PHP 7.4 module is enabled:
a2query -m php7.4
php7.4 (enabled by maintainer script)
cat /etc/apache2/mods-enabled/php7.4.{load,conf}

Config files:

# Conflicts: php5
# Depends: mpm_prefork
LoadModule php7_module /usr/lib/apache2/modules/
<FilesMatch ".+\.ph(ar|p|tml)$">
    SetHandler application/x-httpd-php
<FilesMatch ".+\.phps$">
    SetHandler application/x-httpd-php-source
    # Deny access to raw php sources by default
    # To re-enable it's recommended to enable access to the files
    # only in specific virtual host or directory
    Require all denied
# Deny access to files without filename (e.g. '.php')
<FilesMatch "^\.ph(ar|p|ps|tml)$">
    Require all denied
# Running PHP scripts in user directories is disabled by default
# To re-enable PHP in user directories comment the following lines
# (from <IfModule ...> to </IfModule>.) Do NOT set it to On as it
# prevents .htaccess files from disabling it.
<IfModule mod_userdir.c>
    <Directory /home/*/public_html>
        php_admin_flag engine Off

Configuring Adminer

To activate adminer app run any one of the following a2enconf command sudo a2enconf adminer.conf
## OR ##
sudo a2enconf adminer


Enabling conf adminer.
To activate the new configuration, you need to run:
  systemctl reload apache2

Now all you have to do is restart or reload the Apache 2 server, enter:
sudo systemctl reload apache2
The default config file is located at /etc/apache2/conf-enabled/adminer.conf and viewed using the cat command:
sudo cat /etc/apache2/conf-enabled/adminer.conf

# Adminer on Ubuntu 20.04 #
Alias /adminer /etc/adminer
<Directory /etc/adminer>
	Require all granted
	DirectoryIndex conf.php

Test the installation

You can access the Adminer app using the following URL format:

Now all you have to do is provide database type (MySQl, PGSQL), server IP/hostname, database username/password, and database name to login and manage the database:

A note about firewall configuration

Say Apache/adminer is running on the host having IP address and database server is at, then allow access using the ufw (type command on mysql/mariadb server):
sudo ufw allow from to port 3306 proto tcp comment 'allow mysql access for Adminer/Apache IP'
See UFW on Ubuntu 20.04 LTW page for detailed information. Next, you need to make sure database permissions and password are correct, otherwise admire would not be able to connect to your database server. In other words, create an admin user for admirer as follows (again type these on on your mysql/mariadb server). The syntax is:

## IF ADMINER/Apache server IP IS, THEN CREATE log IN USER named vivek ##
CREATE USER 'vivek'@'' IDENTIFIED BY 'Super_Secret_PassWord_Here';

Log in session

Adminer in action


In this tutorial, you learned how to install Adminer on Ubuntu 20.04 LTS Linux server. I strongly suggest that you run Adminer over HTTPS-based session (see “How To Secure Apache with mod_md Let’s Encrypt on Ubuntu 20.04 LTS“) and password protect your domain or /adminer/ URL for security reasons. See Adminer website here for more info.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 1 comment so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf duf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Modern utilitiesbat exa
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg glances gtop jobs killall kill pidof pstree pwdx time vtop
Searchingag grep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
1 comment… add one
  • jj hurley Sep 16, 2020 @ 16:53

    FYI: I see no reference to either MySQL or MariaDB being installed. Otherwise, thank you.

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum