How to Install phpMyAdmin on Ubuntu 22.04

Install and configure PHPMyAdmin on ubuntu 22.04; Through this tutorial, we will learn how to install and configure PHPMyadmin on ubuntu 22.04 system.

phpMyAdmin is a free software tool written in PHP that is intended to handle the administration of a MySQL or MariaDB database server. You can use phpMyAdmin to perform most administration tasks, including creating a database, running queries, and adding user accounts.

How to install phpMyAdmin on Ubuntu 22.04

Use the following steps to install and configure phpMyAdmin on ubuntu 22.04 system:

  • Step 1 – Update System Dependencies
  • Step 2 – Install PhpMyAdmin
  • Step 3 – Configure PHPMyAdmin
  • Step 4 – Restart Apache Server
  • Step 5 – Login to PHPMyAdmin

Step 1 – Update System Dependencies

Open command prompt and execute the following command to update latest system dependencies:

Step 2 – Install PhpMyAdmin

Use the following command to install phpmyadmin on ubuntu 22.04 system:

sudo apt install phpmyadmin

Step 3 – Configure PHPMyAdmin

Execute the following command on command prompt to configure phpmyadmin for Apache:

sudo nano /etc/apache2/conf-available/phpmyadmin.conf

After that, add the following line into apache2.conf file and save it:

Alias /phpmyadmin /var/www/html/phpmyadmin

Options Indexes FollowSymLinks
DirectoryIndex index.php

AddType application/x-httpd-php .php

php_flag magic_quotes_gpc Off
php_flag track_vars On
php_flag register_globals Off
php_value include_path .

# Authorize for setup

AuthType Basic
AuthName "phpMyAdmin Setup"
AuthUserFile /etc/phpmyadmin/htpasswd.setup

Require valid-user

# Disallow web access to directories that don't need it

Order Deny,Allow
Deny from All

Order Deny,Allow
Deny from All

Using the following command to enable the configuration:

sudo a2enconf phpmyadmin.conf

Step 4 – Restart Apache Server

Use the following command to restart apache web server on ubuntu 22.04:

sudo service apache2 restart

Step 5 – Login to PHPMyAdmin

Open your browser and type the below url with server ip:


Then you will look like on your browser:


Through this tutorial, we have learned how to install and configure phpmyadmin on ubuntu 22.04 server.


My name is Devendra Dode. I am a full-stack developer, entrepreneur, and owner of I like writing tutorials and tips that can help other developers. I share tutorials of PHP, Python, Javascript, JQuery, Laravel, Livewire, Codeigniter, Node JS, Express JS, Vue JS, Angular JS, React Js, MySQL, MongoDB, REST APIs, Windows, Xampp, Linux, Ubuntu, Amazon AWS, Composer, SEO, WordPress, SSL and Bootstrap from a starting stage. As well as demo example.

Leave a Reply

Your email address will not be published. Required fields are marked *