How to Install phpMyAdmin on Ubuntu Server 16.04

Here is how to install phpMyAdmin on Ubuntu Server 16.04

First, update repositories and upgrade installed packages:

sudo apt-get update && sudo apt-get uprgade

Next, install the following packages:

sudo apt-get install phpmyadmin php-mbstring php-gettext

The installation wizard will start. Every step is self-explained. Follow the wizard to setup phpmyadmin according to your needs.

If for some reason the configuration wizard didn’t start, use dpkg-reconfigure phpmyadmin

Here is our configuration, as example:

  • Reinstall database for phpmyadmin? yes
  • Connection method for MySQL database of phpmyadmin: Unix socket
  • MySQL database name for phpmyadmin: phpmyadmin
  • MySQL username for phpmyadmin: phpmyadmin
  • Name of the database’s administrative user: debian-sys-maint
  • Web server to reconfigure automatically: apache2

It’s done. Now you should be able to access phpmyadmin at: name.tld/phpmyadmin/

You can monitor MySQL Server at: name.tld/phpmyadmin/server_status_monitor.php

To increase the security, you may consider changing the default port and URL suffix, or even using software like Fail2Ban. Another simple practice is to setup .htaccess user/password authentication.