In this quick article, you will learn how to install PhpMyAdmin on different Linux distributions.

PhpMyAdmin is a free and open-source administration tool for database servers like MySQL and MariaDB. It is a portable web-based application primarily written in PHP, it has become one of the most popular MySQL administration tools, especially for web hosting providers. However, it’s also a great tool for a local development environment.

Before going to the installation for PhpMyAdmin, make sure you have the LAMP stack properly configured in your system. If not then check out this guide: How to install & configure LAMP stack on Linux

Let’s get into the installation and configuration for PhpMyAdmin on Linux.

Installing PhpMyAdmin On Linux

PhpMyAdmin can be easily installtion on different Linux distributions using the package manager. It is already available in the officail repository.

For Ubuntu, Debian or any of their derivatives, use this installation command.

sudo apt-get install phpmyadmin

For Fedora, CentOS or Redhat.

sudo dnf install phpmyadmin

In the middle of the installation it will ask you the server that you are using, select the one you are using. For most of you it probably be the apache2.

Chose the server for phpmyadmin

Next, you will be asked to configure database for phpMyAdmin. If you want to automatically configure a database for PhpMyAdmin then choose yes and provide the password for it. Otherwise select no.

Creating phpmyadmin user in the database.

If you chose Yes, then you have to provide a password for it.

Entering password for phpmyadmin user in the database

After the installation, you can head on to the server address, if it is installed locally then use the localhost address.


PhpMyAdmin up and running on Linux

Some troubleshoot for PhpMyAdmin

You may get, phpMyAdmin not found error on the browser and it probably due to the configuration issue. It can be mitigated using this solution.

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

Now simply, restart the server.

On Ubuntu or Debian based distros:

sudo systemctl restart apache2

For Fedora, CentOS or Redhat:

sudo systemctl restart httpd

Watch Video guide on YouTube

Additionally, You can also watch a step-by-step video guide on YouTube to get a better understanding of it.


So that’s it on how to install and configure phpMyAdmin on Linux. Let me know what you think about it in the comments and subscribe to the LinuxH2O Youtube channel. Till then, keep enjoying Linux.