Identify Apache’s DocumentRoot
$ grep DocumentRoot /etc/apache2/sites-available/000-default.conf
DocumentRoot /var/www/html
Download Latest Version of phpMyAdmin
$ cd /var/www/html
$ sudo wget https://files.phpmyadmin.net/phpMyAdmin/4.7.7/phpMyAdmin-4.7.7-english.tar.gz
$ ls
index.html phpMyAdmin-4.7.7-english.tar.gz
Extract the files
sudo tar xvzf phpMyAdmin-4.7.7-english.tar.gz
Rename the folder
sudo mv phpMyAdmin-4.7.7-english phpmyadmin
Remove the files
sudo rm phpMyAdmin-4.7.7-english.tar.gz
Secure /phpmyadmin Directory
$ sudo adduser phpmyadmin
Adding user `phpmyadmin' ...
Adding new group `phpmyadmin' (1001) ...
Adding new user `phpmyadmin' (1001) with group `phpmyadmin' ...
Creating home directory `/home/phpmyadmin' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
sudo chown -R phpmyadmin.phpmyadmin /var/www/html/phpmyadmin
Update phpMyAdmin config.inc With Install Wizard
$ cd /var/www/html/phpmyadmin
sudo mkdir config
sudo chmod o+rw config
sudo cp config.sample.inc.php config/config.inc.php
sudo chmod o+w config/config.inc.php
On AWS Cloud9:
cd -
sudo mv phpmyadmin ~/workspace/phpmyadmin
Run phpMyAdmin Install Wizard
http://example.com/phpmyadmin/setup/index.php
if you work in the localhost
http://127.0.0.1/phpmyadmin/setup/index.php
Under the “Servers” section, click on “New Server.”
Under the “Authentication” tab, type in your MySQL root password in the “Password for Config Auth” box and then click “Apply.”
Remove the phpMyAdmin /config directory for security.
sudo rm -rf /var/www/html/phpmyadmin/config
source: http://www.hostingadvice.com/how-to/install-phpmyadmin-on-ubuntu/