How to Install phpMyAdmin on Ubuntu

Updated at

PhpMyAdmin is a web-based graphical interface used to manage MySQL or MariaDB databases. Here are the steps to install PhpMyAdmin on Ubuntu:

1. Open a terminal on your Ubuntu system.

2. Update the package list using the following command:

sudo apt update

3. Install PhpMyAdmin using the following command:

sudo apt install phpmyadmin

4. During the installation process, you will be prompted to choose a web server. Select the web server that you are using (such as Apache or Nginx) and press Enter.

5. You will then be prompted to configure the PhpMyAdmin database. Select Yes and press Enter.

6. Next, you will be prompted to enter a password for the PhpMyAdmin database. Select a strong and secure password, and then confirm it.

7. After the installation is complete, you need to configure your web server to serve PhpMyAdmin. For Apache web server, create a symbolic link to the PhpMyAdmin directory in the web server document root directory:

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

For Nginx web server, add the following block to the server block in the Nginx configuration file (/etc/nginx/sites-available/default):

location /phpmyadmin {
root /usr/share/;
index index.php;
try_files $uri $uri/ =404;
location ~ ^/phpmyadmin/(.+\.php)$ {
root /usr/share/;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;

After editing the Nginx configuration file, save the changes and restart Nginx:

sudo systemctl restart nginx

8. Finally, open a web browser and navigate to the PhpMyAdmin URL. If you followed the Apache configuration above, the URL is:


If you followed the Nginx configuration, the URL is:


Log in with the username "root" and the password you selected during the installation process.

That's it! Now, you have installed and configured PhpMyAdmin on your Ubuntu system and can use it to manage your MySQL or MariaDB databases.

YottaSrc footer

why choose us?

Better Pricing, Fast SSD Storage and Real 24/7
Technical Support.

control panel icon

Managing Your Site Through CPanel With The Latest Version

security icon

99.8% Uptime Guarantee.
So Focus On Your Work!

support icon
24/7/365 Support

Day or night, rain or shine,
our team is here for you!

cloud backup icon
Daily Backup

Daily & Weekly Backup.
Your Files Are Safe!