How to Install PhpMyAdmin in Ubuntu 21.04

In this guide, we will demonstrate how phpmyadmin is installed on a Ubuntu 20.04 system. Phpmyadmin requires a standalone Database or as part of LEMP stack, installed and running on the system before hand.

Prerequisites:

Server with Nginx, PHP and MariaDB. You can find our LEMP Installation guide here.

OR

Server with Apache, PHP and MariaDB. We also have the guide for LAMP Stack as well here.

Installling PhpMyAdmin

apt install phpmyadmin

Output:

root@vps:~# apt install phpmyadmin
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Suggested packages:
  www-browser php-recode php-gd2 php-pragmarx-google2fa php-samyoul-u2f-php-server
The following NEW packages will be installed:
  phpmyadmin
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 4,426 kB of archives.
After this operation, 27.2 MB of additional disk space will be used.
Get:1 http://de.archive.ubuntu.com/ubuntu hirsute/universe amd64 phpmyadmin all 4:4.9.7+dfsg1-1 [4,426 kB]
Fetched 4,426 kB in 0s (18.8 MB/s)
Preconfiguring packages ...
...

Create Symbolic Link

Create a symbolic link from the installation files to Nginx's document root directory.

ln -s  /usr/share/phpmyadmin /var/www/html/phpmyadmin

Enter it into your browser's address bar to check phpmyadmin is installed. http://yourserver-ip-address/phpmyadmin/. You should see a page similar to below one.

image

Done!