How To Install PhpMyAdmin on Ubuntu Server

About PhpMyAdmin

phpMyAdmin is a free web software created to work with MySQL on the web. It provides a convenient visual front-end to the MySQL capabilities.


Before anything can get started you must have the LAMP (Linux, Apache, MySQL, PHP) stack installed  on your server. If you don’t go here first then come back.

Once you have everything in place, let’s get down to business.

Installing PhpMyAdmin

Open up the terminal and enter the following

sudo apt-get install phpmyadmin

During the installation, phpMyAdmin will walk you through a basic configuration. Once the process starts, follow these steps:

  • Select Apache2 for the server
  • Choose YES when asked about whether to configure the database for phpmyadmin with dbconfig-common
  • Enter you MySQL password when prompted
  • Enter the password that you want to use to log into phpmyadmin with

This next step is optional, you can add it, but if apache returns an error just remove the line.

add phpmyadmin to the apache configuration

sudo nano /etc/apache2/apache2.conf

add the phpmyadmin config to the file

Include /etc/phpmyadmin/apache.conf

Restart apache

sudo service apache2 restart

if everything goes well just go to [ipaddress or domain name]/phpmyadmin. The default user is root, and then just enter the password you set for phpmyadmin and that is it.