Would you like to learn how to install PhpMyAdmin on a computer running Ubuntu Linux? In this tutorial, we are going to install and configure PhpMyAdmin using the Nginx server on a computer running Ubuntu Linux.

• Ubuntu 18
• Ubuntu 19
• Ubuntu 20
• Nginx 1.18.0
• PhpMyAdmin 4.9.5

Equipment list

The following section presents the list of equipment used to create this tutorial.

As an Amazon Associate, I earn from qualifying purchases.

Tutorial PhpMyAdmin - MySQL installation

Install the MySQL database service.

Copy to Clipboard

Access the MySQL service command-line.

Copy to Clipboard

Set a password to the MySQL root user.

Copy to Clipboard

In our example, we set the Mysql password: Kamisama123

Try to access the MySQL service using the new password.

Copy to Clipboard

Create a database named phpmyadmin.

Copy to Clipboard

Create a Mysql user account named PMA

Copy to Clipboard

In our example, we set the Mysql password: Kamisama123

Grant the PMA user account permission over the database named PHPMYADMIN.

Copy to Clipboard

Download the PhpMyAdmin installation package.

Copy to Clipboard

Import the PhpMyAdmin's database template using the account named PMA.

Copy to Clipboard

You have finished the PhpMyAdmin database installation.

Tutorial PhpMyAdmin - Nginx installation

Install the Nginx web server and all the required packages.

Copy to Clipboard

Install the PHP package.

Copy to Clipboard

Install other PHP modules.

Copy to Clipboard

Find the location of the PHP configuration file on your system.

Edit the configuration file named: PHP.INI.

Copy to Clipboard

Your PHP version may not be the same as ours.

Your PHP configuration file location may not be the same as ours.

Enable and configure the following items of the PHP configuration file.

Copy to Clipboard

Set the correct timezone to your location.

Edit the Nginx configuration file for the default website.

Copy to Clipboard

Enable the PHP support for Nginx.

Here is the original file, before our configuration.

Copy to Clipboard

Here is the new file with our configuration.

Copy to Clipboard

Verify if your Nginx configuration file has no error.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Restart the PHP service.

Copy to Clipboard

Restart the Nginx service.

Copy to Clipboard

You have finished the Nginx service installation with PHP support.

Tutorial PhpMyAdmin - Installation on Ubuntu

Move the PhpMyAdmin directory to the Nginx root directory.

Copy to Clipboard

Create the list of required directories.

Copy to Clipboard

Set the correct permissions.

Copy to Clipboard

Create the PhpMyAdmin's configuration file.

Copy to Clipboard

Edit the configuration file.

Copy to Clipboard

Enable and configure the following items of the configuration file.

Copy to Clipboard

Use the following command to generate the random key used on the parameter named: BLOWFISH_SECRET

Copy to Clipboard

Open your browser and enter the IP address of your web server plus /phpmyadmin.

In our example, the following URL was entered in the Browser:

• http://172.31.8.195/phpmyadmin

The PhpMyAdmin login screen will be displayed.

On the Login screen, enter the MySQL's ROOT account information.

PhpMyAdmin Login

After a successful login, The PhpMyAdmin dashboard will be displayed.

PhpMyAdmin Dashboard

Congratulations! You have finished the installation of PhpMyAdmin.

Tutorial PhpMyAdmin - Basic authentication

The PhpMyAdmin software provides a direct interface to the MySQL service.

We are going to configure an extra layer of authentication to protect the initial access to PhpMyAdmin.

Create the password file and add the first user account.

Copy to Clipboard

The system will request you to enter the password to the new user account.

Copy to Clipboard

Here is the file content.

Copy to Clipboard

To create additional user accounts, use the following command.

Copy to Clipboard

Edit the Nginx configuration file for the default website.

Copy to Clipboard

Create a new location named PHPMYADMIN.

Copy to Clipboard

Here is the file after our configuration.

Copy to Clipboard

Restart the Nginx service.

Copy to Clipboard

Open your browser and enter the IP address of your web server plus /phpmyadmin.

In our example, the following URL was entered in the Browser:

• http://172.31.8.195/phpmyadmin

The Nginx server will require you to perform the user authentication.

Nginx authentication

After a successful login, The PhpMyAdmin login screen will be presented.

PhpMyAdmin Login

After a successful login, the PhpMyAdmin dashboard will be displayed.

PhpMyAdmin Dashboard

Congratulations! You have finished the installation of PhpMyAdmin.