How to Install phpMyAdmin on Debian 10 (Buster)


The phpMyAdmin utility is a graphical database management tool. By installing phpMyAdmin, you no longer need to use a default command-line interface to manage your databases.

PhpMyAdmin is a web-based application and requires the LAMP stack to work properly. This guide shows you how to lay the groundwork and install phpMyAdmin on Debian 10.

tutorial on how to Install and Secure phpMyAdmin on Debian 10


Step 1: Install LAMP Stack on Debian 10

You need a functioning web server for phpMyAdmin to work properly. This section shows you how to install the supporting software to turn your Debian 10 system into a web server.

If you already have a LAMP stack installed, you can skip directly to the Download phpMyAdmin section.

Step 1.1: Update Software Packages and Install wget

Access your terminal window, and update your software package lists using the following command:

sudo apt update

Installing outdated software packages is a severe security liability. Do not skip this step.

The wget utility allows you to download files directly from the terminal window. Enter the following command to install the wget tool:

sudo apt install wget -y

You now have the tools you need to install a LAMP stack and phpMyAdmin.

Step 1.2: Install Apache

Apache is the webserver software that processes requests and transmits data over an HTTP network. Open a terminal window, and install Apache by entering the following command:

sudo apt install apache2 -y

The process can take a few moments to complete. Enter the following command to make sure the Apache service is running:

systemctl status apache2

In the report that follows, you should see a green status that says active (running).

Status of Apache web-server on Debian 10.

Press Ctrl+z to return to the command prompt.

Step 1.3: Install PHP on Debian 10

The PHP programming language and coding environment is essential for running a web application like phpMyAdmin. Install core PHP packages and Apache and MySQL plugins with the following command:

sudo apt install php php-cgi php-mysqli php-pear php-mbstring php-gettext libapache2-mod-php php-common php-phpseclib php-mysql -y

Once the installation process is complete, verify that PHP has been installed:

php --version

The system displays the current version of PHP, along with the date of the release.

The version of PHP currently intalled on Debian 10 system.

Step 1.4: Install and Set Up MariaDB on Debian 10

This guide uses the MariaDB open-source relational database management system instead of MySQL. MariaDB and MySQL are compatible, and many of the commands and features are identical.

To install MariaDB, enter the following command into your terminal:

sudo apt install mariadb-server mariadb-client -y

Once the process is complete, verify the MariaDB installation with the following command:

systemctl status mariadb

Like with Apache, you see an active (running) status.

System confirms that the MariaDB service is active and running on Debian 10.

Before installing phpMyAdmin, you need to configure the MariaDB database.

Secure MariaDB

Configure basic MariaDB security features by launching a built-in script:

sudo mysql_secure_installation

As you have not yet set a root password for your database, hit Enter to skip the initial query. You are now presented with the following options:

  • Set root password? [Y/n] – Type y and press Enter to create a strong root password for your database.
  • Remove anonymous users? [Y/n] – Type y and press Enter.
  • Disallow root login remotely? [Y/n] – Type y and press Enter.
  • Remove test database and access to it? [Y/n] – Type y and confirm with Enter.
  • Reload privilege tables now? [Y/n] – Type y and confirm with Enter.

The output confirms that your MariaDB installation is now secure.

screenshot showing you have successfully secured the MariaDB installation on Debian 10

Create a New MariaDB User

The phpMyAdmin utility needs a designated user to be able to connect to your database. Creating a new MariaDB user improves security and allows you to control the level of permissions granted to this user.

Use our detailed guide to create a new MariaDB user and grant privileges. Once you have set up a MariaDB user, you are ready to start the phpMyAdmin installation process.

Step 2: Download phpMyAdmin

Use the wget command to retrieve the latest stable version of phpMyAdmin:

wget -P Downloads

The -P option instructs wget to save the files directly in the Downloads directory. Feel free to specify any directory you see fit.

phpMyAdmin downloading in Debian 10

Note: At the time of writing this article, the latest version is phpMyAdmin 5.0.2. For a specific version, or to check the latest version, please see the developer’s download page.

Step 3: Check phpMyAdmin GPG Key

Each downloaded archive has a corresponding .asc file that contains its unique key signature. Once both files are in the same folder, the signature can be verified.

  1. To verify the GPG key for phpMyAdmin, download the phpMyAdmin keyring to the Downloads directory:
wget -P Downloads
  1. Access the Downloads directory and import the keyring:
cd Downloads
gpg --import phpmyadmin.keyring
System imports gpg keyring to verigy phpmyadmin download files
  1. Download the corresponding GPG .asc file for your version of phpMyAdmin:
wget -P Downloads
  1. Access the Downloads directory and verify the .asc file against the keyring you downloaded:
cd Downloads
gpg --verify phpMyAdmin-latest-all-languages.tar.gz.asc

The system responds by displaying GPG key information.

output provides the GPG key to verify the downloaded files

You can now compare the GPG key to the developer credentials on the documentation page.

Step 4: Unpack and Configure phpMyAdmin

  1. Create a phpMyAdmin directory in the Apache web root directory:
sudo mkdir /var/www/html/phpMyAdmin
  1. Access the Downloads directory and unpack the phpMyAdmin tar.gz files to the newly created directory:
cd Downloads
sudo tar xvf phpMyAdmin-latest-all-languages.tar.gz --strip-components=1 -C /var/www/html/phpmyadmin
  1. Create a default configuration file:
sudo cp /var/www/html/phpmyadmin/ /var/www/html/phpmyadmin/
  1. Use the nano text editor (or your preferred text editor), to add a secret passphrase to the file:
sudo nano /var/www/html/phpmyadmin/

Locate the following line:

$cfg['blowfish_secret'] = '';
Add passphrase to the phpmyadmin config file.

Add a secret passphrase as follows:

$cfg['blowfish_secret'] = 'my_secret_passphrase';

Use a complex passphrase of your choice and then exit and save the file (Ctrl+x).

  1. Change the permissions for the
sudo chmod 660 /var/www/html/phpmyadmin/
  1. Change ownership of the phpmyadmindirectory:
sudo chown -R www-data:www-data /var/www/html/phpmyadmin
  1. Restart Apache:
sudo systemctl restart apache2

Step 5: Access phpMyAdmin from Browser

Use your preferred web browser and navigate to the following web address:


The system prompts the phpMyAdmin login screen and establishes a connection to the local Apache, MariaDB, and PHP files that you have created.

The phpMyAdmin logon page.

Log in to phpMyAdmin with the username and password for the MariaDB user you had created and granted privileges to.

The phpMyAdmin grahical user-interface.

Take your time and explore the many options and settings phpMyAdmin has to offer.


You have now installed phpMyAdmin on your Debian 10 system. Access the graphical user interface from your browser and start administering your databases more efficiently.

Was this article helpful?
Vladimir Kaplarevic
Vladimir is a resident Tech Writer at phoenixNAP. He has more than 7 years of experience in implementing e-commerce and online payment solutions with various global IT services providers. His articles aim to instill a passion for innovative technologies in others by providing practical advice and using an engaging writing style.
Next you should read
How to Install phpMyAdmin on CentOS 8
June 2, 2020

The phpMyAdmin software is used for working with MySQL databases through a graphical interface. It can be...
Read more
How to Upgrade to Ubuntu 20.04
May 7, 2020

Ubuntu 20.04 (Focal Fossa) is the newest Ubuntu LTS release. You can upgrade to the latest release from an...
Read more
How To Install Debian 10 (Buster)
October 14, 2019

Debian has released its newest stable version Debian 10, nicknamed Buster. The latest release includes many...
Read more
How to upgrade Debian 9 Stretch to Linux Debian 10 Buster
March 29, 2019

Debian 10, codenamed Buster, is still a work in progress, but a pre-release version is available. Even though...
Read more
  • © 2022 Copyright phoenixNAP | Global IT Services. All Rights Reserved.