In today’s guide, we will discuss how you can Install phpMyAdmin on Debian 10 (Buster) Linux. phpMyAdmin is a free and Open source Web application written in PHP for administering MySQL and MariaDB database servers. It is mostly used by Developers and DBAs to interact with a database server because of its ease of use.

install phpmyadmin with apache debian 10

phpMyAdmin provides an advanced SQL editor which makes it easy to build and test complex SQL queries. It also allows you to manage Databases, Users, Data import and export, stored procedures and triggers, execute and edit queries, search database globally and much more.

This tutorial explains the steps for installing phpMyAdmin with Apache on Debian 10 (Buster). Let’s get started.

Step 1: Install PHP

PHP is the main software requirement for running phpMyAdmin. Install it using our guide below.

Install PHP on Debian 10

For simplicity, the commands below can be executed to install PHP and extensions required.

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

Step 2: Install MariaDB Database Server

If you don’t have existing Database server to manage, you can use our guide to install MariaDB database server on Debian 10.

How to Install MariaDB on Debian 10 Buster

Step 3: Install Apache Web Server

For this installation setup, we chose Apache as a web server to use with phpMyAdmin. You are free to choose whichever web server you prefer though, e.g Nginx.

Install Apache Web Server on Debian 10 by running the following commands

sudo apt-get -y install wget apache2

Step 4: Install phpMyAdmin on Debian 10

You can check the released of phpMyAdmin from the downloads page. Thanks William Desportes for the hint on how to pull the latest release of phpMyAdmin.

Download latest version of phpMyAdmin with wget command.

DATA="$(wget -q -O-)"
URL="$(echo $DATA | cut -d ' ' -f 3)"
VERSION="$(echo $DATA | cut -d ' ' -f 1)"

For English language only package, use:


Extract downloaded Archive:

tar xvf phpMyAdmin-${VERSION}-all-languages.tar.gz

Move the resulting folder to /usr/share/phpmyadmin folder.

sudo mv phpMyAdmin-*/ /usr/share/phpmyadmin

Create directory for phpMyAdmin temp files.

sudo mkdir -p /var/lib/phpmyadmin/tmp
sudo chown -R www-data:www-data /var/lib/phpmyadmin

Create directory for phpMyAdmin configuration files such as htpass file.

sudo mkdir /etc/phpmyadmin/

Create phpMyAdmin configuration file.

sudo cp /usr/share/phpmyadmin/  /usr/share/phpmyadmin/

Edit the file /usr/share/phpmyadmin/ and set secret passphrase:

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

Configure Temp directory:

$cfg['TempDir'] = '/var/lib/phpmyadmin/tmp';

Step 5: Configure Apache web Server

Create phpMyAdmin Apache configuration file:

sudo vim /etc/apache2/conf-enabled/phpmyadmin.conf

And paste below contents to the file:

Alias /phpmyadmin /usr/share/phpmyadmin

<Directory /usr/share/phpmyadmin>
    Options SymLinksIfOwnerMatch
    DirectoryIndex index.php

    <IfModule mod_php5.c>
        <IfModule mod_mime.c>
            AddType application/x-httpd-php .php
        <FilesMatch ".+\.php$">
            SetHandler application/x-httpd-php

        php_value include_path .
        php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp
        php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/:/usr/share/php/php-gettext/:/usr/share/php/php-php-gettext/:/usr/share/javascript/:/usr/share/php/tcpdf/:/usr/share/doc/phpmyadmin/:/usr/share/php/phpseclib/
        php_admin_value mbstring.func_overload 0
    <IfModule mod_php.c>
        <IfModule mod_mime.c>
            AddType application/x-httpd-php .php
        <FilesMatch ".+\.php$">
            SetHandler application/x-httpd-php

        php_value include_path .
        php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp
        php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/:/usr/share/php/php-gettext/:/usr/share/php/php-php-gettext/:/usr/share/javascript/:/usr/share/php/tcpdf/:/usr/share/doc/phpmyadmin/:/usr/share/php/phpseclib/
        php_admin_value mbstring.func_overload 0


# Authorize for setup
<Directory /usr/share/phpmyadmin/setup>
    <IfModule mod_authz_core.c>
        <IfModule mod_authn_file.c>
            AuthType Basic
            AuthName "phpMyAdmin Setup"
            AuthUserFile /etc/phpmyadmin/htpasswd.setup
        Require valid-user

# Disallow web access to directories that don't need it
<Directory /usr/share/phpmyadmin/templates>
    Require all denied
<Directory /usr/share/phpmyadmin/libraries>
    Require all denied
<Directory /usr/share/phpmyadmin/setup/lib>
    Require all denied

You can restrict access from specific IP by adding line like below:

Require ip

Restart apache web server.

sudo systemctl restart apache2

Step 5: Visit phpMyAdmin Web interface

Access phpMyAdmin Web interface on http://[ServerIP|Hostname]/phpmyadmin. Use your database credentials – username & password to login.


phpMyAdmin dashboard is displayed upon a successful login. It looks something like this:

phpmyadmin debian 10 dashboard

PHP Web Programming Video Courses:


You now have a phpMyAdmin installed on Debian 10. You can start managing your database server from a Web dashboard and stress less on mastering MySQL command line.

For other systems, check:

Install and Configure phpMyAdmin on Fedora

Install and Configure phpMyAdmin on RHEL / CentOS 8

Your support is our everlasting motivation,
that cup of coffee is what keeps us going!

As we continue to grow, we would wish to reach and impact more people who visit and take advantage of the guides we have on our blog. This is a big task for us and we are so far extremely grateful for the kind people who have shown amazing support for our work over the time we have been online.

Thank You for your support as we work to give you the best of guides and articles. Click below to buy us a coffee.


Please enter your comment!
Please enter your name here