Install phpMyAdmin on Ubuntu 20.04 with Apach



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.20.04 and secure it.

  • Prerequisites

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.


  • 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.

https://domain.com/phpmyadmin

  • Conclusion

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

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


Comments