Install phpMyAdmin
Let’s begin by updating the package lists and installing phpMyAdmin for Nginx on Ubuntu 20.04 / 20.10.
sudo apt update && sudo apt install phpmyadmin
Press Y
and ENTER
to continue the installation phpMyAdmin package.
Select Nothing
If you are prompted to choose a web server like below, as there is no option for Nginx, press TAB
and then ENTER
to continue without selecting a web server.

Configure Database
Select Yes
and press ENTER
to install and configure the database.

Application Password
The MySQL application password is used internally by phpMyAdmin to communicate with MySQL and it is not recommended that you use it to log into phpMyAdmin. You can leave this blank and a password will be generated automatically.
Press ENTER
to continue or you've entered your password press Ok
then enter again for password confimation.

Success install phpMyAdmin.
Create Symbolic Link
In order for Nginx to serve the phpMyAdmin files correctly, we must create a symbolic link from the phpMyAdmin directory /usr/share/phpmyadmin
to the Nginx document root directory.
The default location of the Nginx document root in Ubuntu 20.04 / 20.10 should be /var/www/html/
, though it could be different depending on your setup. If you setting up multiple domains for Nginx, your document root may be located in somewhere like /var/www/example.com/public_html
.
Once you have confirmed your document root, let’s create a symbolic link from the phpMyAdmin directory to your document root. Here we will assume your document root is /var/www/html/
and we will simply add phpmyadmin
to the end of it.
sudo ln -s /usr/share/phpmyadmin /var/www/html/phpmyadmin
Test phpMyAdmin
You should now be able to access the phpMyAdmin web interface by visiting your server’s domain name or public IP address followed by /phpmyadmin
. e.g. http://example.com/phpmyadmin
or http://Your_IP/phpmyadmin
.

If you enter the password at Application Password section you can log in using phpmyadmin as username and password that you enter early.
For user root you need to update the password.
You've completed this section, try to login your phpMyAdmin.
Last updated
Was this helpful?