Linux MySQL

Install phpMyAdmin on Ubuntu 22.04 with Apache

Disclosure: This post may contain affiliate links, which means we may receive a commission if you click a link and purchase something that we recommended.

Pinterest LinkedIn Tumblr

phpMyAdmin is a web-based application for interacting with MySQL database server. This tool provides you with a user interface to make MySQL operations so you don’t have to use the command line interface.

In this guide you are going to learn how to install phpMyAdmin with Apache on Ubuntu 22.04 and secure it.


Make sure you have LAMP setup in your server with Apache, PHP and MySQL/MariaDB. If you don’t have the server setup you can follow the below guide to setup.
How to Install LAMP Apache, MySQL, PHP in Ubuntu 22.04

Install phpMyAdmin

Once you have your LAMP setup you can start by installing phpMyAdmin.

There are different ways to install phpMyAdmin, here we will follow the easiest way to install it.

Execute the below command to install phpMyAdmin.

sudo apt install phpmyadmin

In the prompt to choose web server, select Apache.

When prompted again to allow dbconfig-common to install a database and configure select Yes and press ENTER.

Then type and confirm a password or allow to use any random password.

Configure phpMyAdmin for Apache

Once phpMyAdmin is installed you can configure it with Apache so you can access the web interface.

Copy the phpmyadmin.conf from our installation to Apache’s conf-available directory.

sudo cp /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf

Enable the configuration using a2enconf command.

sudo a2enconf phpmyadmin

Restart Apache for the changes to take effect.

sudo service apache2 restart

Now you can access phpMyAdmin using your domain followed by /phpmyadmin.


Now you have learned how to install phpMyadmin on Ubuntu 22.04 with Apache.

Thanks for your time. If you face any problem or any feedback, please leave a comment below.

1 Comment

Write A Comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.