How to install the Adminer program on Ubuntu 20.04 LTS for Internet database management?
Adminer (formerly known as phpMinAdmin) is a free and open source database management tool. It’s written in PHP. Compared to phpMyAdmin, it is a light application with a high degree of security and user-friendliness. This tutorial describes the installation of Adminer on a Linux Ubuntu 20.04 LTS server for MySQL or MariaDB.
Procedure for installing an administrator on a Ubuntu Linux server 20.04
- Update the Ubuntu server where sudo apt & sudo apt update is running
- Make sure the Apache server is installed and configured in Ubuntu.
- Activate, execute the configuration: sudo a2 in adminconf
- Install the administrator by entering the sudo apt command install adminer
Of course, you will need to install Apache or another web server. Learn how to install Apache 2 on Ubuntu 20.04 LTS. Now that the Apache web server is installed and running, we get our hands dirty installing Adminer.
First you need to upgrade your system with the command apt/apt-get, then install Adminer:
sudo apt Upgrade
sudo apt Upgrade
sudo apt Administrator Installation
Note: besides Apache PHP is needed to run Adminer. As a result apt has installed and configured PHP automatically. Other web servers require manual configuration. Use the cat command to check that the PHP 7.4 module is enabled:
a2query -m php7.4
php7.4 (enabled by the maintenance script)
configuration files :
|# Conflicts: php5
# Depends on: mpm_prefork
require # Disable access to files without filenames (e.g., “File”, “File”, “File”, “File”, “File”,” “File”, “File”,” “File”).(e.g. ‘.php’)
php_admin_flag motor Off
# Conflicts: php5
# Depends: mpm_prefork
LoadModule php7_module /usr/lib/apache2/modules/libphp7.4.so
# 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’)
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 to .) Do NOT set it to On as it
# prevents .htaccess files from disabling it.
php_admin_flag engine Off
To activate the administration application, execute one of the following commands: a2enconf
sudo a2enconf adminer.conf
## OR ##
sudo a2enconf adminer
Activate Confederate Administrator.
To activate the new configuration, you must:
systemctl restart apache2.
All you have to do is restart the Apache 2 server, type:
sudo systemctl reboot apache2
The default configuration file is in /etc/apache2/conf-enabled/adminer.conf and can be accessed with the command cat:
|# Administrator on Ubuntu 20.04 #
alias /adminer /etc/adminer
# Adminer on Ubuntu 20.04 #
Alias /adminer /etc/adminer
Require all granted
You can access the administration application using the following URL format:
Now all you have to do is specify the database type (MySQl, PGSQL), server IP/hostname, database username/password and database name to log in and manage the database :
Firewall configuration Note
Assuming that Apache/administrator is running on a host with an IP address of 10.105.28.9 and the database server is set to 172.16.3.1:3306, allow access with ufw (a command of the type on the mysql/mariadb server):
ufw allow access with 10.105.28.9 to 172.16.3.1 port 3306 proto tcp How to make ‘mysql access for Adminer/Apache IP’
Then you must make sure that the database access rights and password are correct, otherwise the admiration can not connect to your database server. In other words: Create an admin user for the ventilator as follows (to be entered on your mysql/mariadb server) The syntax is as follows:
|Create the user admin’@’YOUR ADMINER SERVER IP identified by YOUR PASSWORD;
Set all personal information to *.* to admin’@’YOUR ADMINER SERVER IP with the option GRANT ;
## IF ADMINISTRATOR/Server Apache IP 10.105.28.9, CREATE A LOGIN USER named vivek ##
CREATE USER ‘admin’@’YOUR-ADMINER-SERVER-IP’ IDENTIFIED BY ‘YOUR-PASSWORD’;
GRANT ALL PRIVILEGES ON *.* TO ‘admin’@’YOUR-ADMINER-SERVER-IP’ WITH GRANT OPTION;
## if ADMINER/Apache server IP is 10.105.28.9, then create log in user named vivek ##
CREATE USER ‘vivek’@’10.105.28.9’ IDENTIFIED BY ‘Super_Secret_PassWord_Here’;
GRANT ALL PRIVILEGES ON *.* TO ‘vivek’@’10.105.28.9’ WITH GRANT OPTION;
Administrator in action
In this tutorial you learned how to install Adminer on the Linux Ubuntu 20.04 server. I strongly advise the administrator to run an HTTPS session (see How to secure Apache with the Let’s Encrypt on Ubuntu 20.04 LTS mod_md) and secure your domain or /adminer/ URL with a password for security reasons. More information can be found here on the site of the administrator.
Published: Vivek gears
The author is the creator of nixCraft and an experienced system administrator, DevOps engineer and Linux/Unix shell script trainer. Receive the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly by email.