Skip to content
William Desportes edited this page Nov 28, 2023 · 54 revisions

There are several options for installing phpMyAdmin on a Debian or Ubuntu system. Most Debian and Ubuntu versions have official packages that can be installed with apt-get install phpmyadmin.

If you are using a version that does not have phpMyAdmin included, or wish to use a newer version, you have several alternatives available.

Tagged issues for packaging are: there

Related issues and comments on install methods

This are comments and issues related to installing phpMyAdmin from different sources:

Ref: Ubuntu Updates RSS

Ubuntu PPA support

5.2 is supported since recently: https://tracker.debian.org/news/1414560/accepted-phpmyadmin-4520dfsg1-2-source-into-unstable/

About 2FA/U2F support: https://github.com/phpmyadmin/phpmyadmin/issues/16779 Fido U2F is supported since recently.

Distro list

More informations about versions: https://endoflife.date/ubuntu

  • 18.04 - ❌⬇️ LTS - bionic (blocked at 5.1.1, last upload: 2021-06-18), ended 04/2023 (outdated packages still available)
  • 19.10 - ❌⬇️ eoan (blocked at 4.9.5, last upload: 2020-03-26), closed: 07/2020 (deleted all packages from the PPA on 17/12/2022)
  • 20.04 - ✅ LTS - focal (last update: 5.2.1 - 2023-04-27) - closes 07/2023
  • 21.10 - ❌⬇️ LTS impish (last update: 5.1.4 - 2022-05-25) - closed 07/2022 (outdated packages still available)
  • 22.04 - ✅ LTS jammy (last update: 5.2.1 - 2023-02-09) - closes 04/2025
  • 22.10 - ⬆️ kinetic not a LTS, use the PPA for jammy.
  • 23.04 - ⬆️ Lunar Lobster not a LTS, use the PPA for jammy.

Old distros

I am unable to upload new changes, Ubuntu rejects them (date of the rejection: 12/02/2022) because the versions are ended/closed.

Rejected: impish is obsolete and will not accept new uploads.
Rejected: bionic is obsolete and will not accept new uploads.
Rejected: eoan is obsolete and will not accept new uploads.

Known issues

TODO by @williamdes, add this to FAQ: https://github.com/phpmyadmin/phpmyadmin/issues/18306#issuecomment-1492710905

test script

<?php
$servername = "127.0.0.1";// Also try "localhost"
$username = "root";
$password = "public";

// Create connection
$conn = new mysqli($servername, $username, $password);

// Check connection
if ($conn->connect_error) {
  die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";

Why does the PPA only support PHP 8.0+

TLDR: Because there is weird issues in Ubuntu with symfony packages.

Because Ubuntu developers decided to patch the symfony packages for PHP 8.0 support ahead of upstream symfony.

Ref: https://git.launchpad.net/ubuntu/+source/symfony/commit/?id=17c9b948dbb832d87573e3e67703982675f03ed9

That makes the original require PHP 8.0 instead of 7.2 (because the PHP 8 syntax is not PHP 7 compatible). They did think it would not be a problem because they shipped PHP 8 in the Ubuntu version. But people tend to use different versions of PHP than the one shipped with Ubuntu. For example by using packages.sury.org.

You need to know that actually there is no way for a PHP library to limit it's usage to a certain PHP version. It depends on PHP and that's all. Knowing that you can install the symfony libraries on PHP 5 for example and it will (probably) not work ! So phpMyAdmin supports PHP 7.2 but if a library has been twisted (on Ubuntu only !) the phpMyAdmin package ends up being affected by this twist. And has to require another minimal version of PHP (on Ubuntu only !).

That's a lot of nonsense (@williamdes's own point of view, think on your own). The way that things are packaged on Ubuntu/Debian is that each dependency of a certain project is contains in another separate package. Making us (the phpMyAdmin team) unable to patch the code of our vendors. Anyway it's bad to patch vendors. You will find them in /usr/share/php/ in separate folders.

How to install

On a non LTS Ubuntu version or on Debian or without add-apt-repository

Ref: (16065#issuecomment-609035410)

Example for: jammy (LTS supported until 04/2025)

# Optionally cleanup old PPA versions
sudo rm -v /etc/apt/sources.list.d/phpmyadmin-ubuntu-ppa-*.list
# Add required packages
apt-get -y install apt-transport-https ca-certificates curl
# Fetch the GPG key and dearmor it
curl -fsSL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x42636ff8dae547240e01a1ca2ea3055293cb3f45" | sudo gpg --dearmor -o /usr/share/keyrings/phpmyadmin-ppa.gpg
# Add the source
sudo sh -c 'echo "deb [signed-by=/usr/share/keyrings/phpmyadmin-ppa.gpg] https://ppa.launchpadcontent.net/phpmyadmin/ppa/ubuntu jammy main" > /etc/apt/sources.list.d/phpmyadmin-ubuntu-ppa-jammy.list'
# Update
apt update
# Check ("Version:" should contain "+jammy")
apt info phpmyadmin
# Install
apt install phpmyadmin

With add-apt-repository (you should be using a LTS Ubuntu version !)

Ref: (15515#issuecomment-552211446)

# Install the "add-apt-repository" command
sudo apt-get install software-properties-common -y
# Add the phpMyAdmin PPA
sudo add-apt-repository ppa:phpmyadmin/ppa
# Update
apt update
# Check ("Version:" should contain "+jammy" or another name related to your Ubuntu version)
apt info phpmyadmin
# Install
apt install phpmyadmin

Bullseye backports

To install from Debian bullseye-backports, create a new apt sources file, /etc/apt/sources.list.d/bullseye-backports.list, and add this line:

deb http://deb.debian.org/debian bullseye-backports main

Then run apt-get update to refresh the package cache.

You can now install phpMyAdmin normally:

apt-get install -t bullseye-backports phpmyadmin

Buster backports

To install from buster-backports, create a new apt sources file, /etc/apt/sources.list.d/buster-backports.list, and add this line:

deb http://deb.debian.org/debian buster-backports main

Then run apt-get update to refresh the package cache.

Because Buster comes with an older version of php-twig, you probably have to manually install the backports version:

apt-get install -t buster-backports php-twig

You can now install phpMyAdmin normally:

apt-get install -t buster-backports phpmyadmin

Ubuntu PPA

There is a Ubuntu PPA maintained by phpMyAdmin team members. Using it is simple:

sudo add-apt-repository ppa:phpmyadmin/ppa
sudo apt-get update
sudo apt-get install phpmyadmin

Documentation links to check from time to time

Manually

Finally, you can always perform a manual installation.

Packaging status

Packaging status

Testing packages

Testing the Ubuntu PPA package with docker

Run an interactive container: docker run --rm -p 8091:80 -p 8092:443 -it ubuntu:jammy bash

apt update
apt upgrade -y
# Install the "add-apt-repository" command
apt install software-properties-common -y
# Add the phpMyAdmin PPA
add-apt-repository ppa:phpmyadmin/ppa
# Follow the instructions of "Install and test the package"

Testing the Debian package with docker (from Debian testing)

Run an interactive container: docker run --rm -p 8091:80 -p 8092:443 -it debian:testing bash

apt update
apt upgrade -y
# Follow the instructions of "Install and test the package"

Testing the Debian package with docker (from Debian sid)

Run an interactive container: docker run --rm -p 8091:80 -p 8092:443 -it debian:sid bash

apt update
apt upgrade -y
# Follow the instructions of "Install and test the package"

Install and test the package

# Install phpMyAdmin
apt install phpmyadmin -y
a2enmod ssl
a2ensite default-ssl
# Start apache2
service apache2 start
# Browse the page http://127.0.0.1:8091/phpmyadmin/ or https://127.0.0.1:8092/phpmyadmin/

Advanced testing

# Advanced testing
apt install mariadb-server -y
# Or use https://mariadb.com/kb/en/mariadb-package-repository-setup-and-usage/
# Start MariaDB
service mariadb start
# Create a database named "public"
mariadb -e "CREATE DATABASE public;"
# Set root password to "public" for login
mariadb -e "SET PASSWORD FOR 'root'@'localhost' = PASSWORD('public');"
# -----------------------------------------------------
#              Alternative syntaxes
# -----------------------------------------------------
# ALTER USER 'root'@'localhost' IDENTIFIED BY 'public';
# ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password by 'public';
# CREATE USER 'test'@'%' IDENTIFIED BY 'public';
# GRANT ALL PRIVILEGES ON *.* TO 'test'@'%';
# FLUSH PRIVILEGES;
# -----------------------------------------------------
# Login on the page http://127.0.0.1:8091/phpmyadmin/
# Enjoy !

Adding data

From: https://github.com/phpmyadmin/scripts/tree/master/demo/sql

# Download data
php -r "file_put_contents('/tmp/world.sql', file_get_contents('https://raw.githubusercontent.com/phpmyadmin/scripts/master/demo/sql/world.sql'));"
php -r "file_put_contents('/tmp/world_borders.sql', file_get_contents('https://raw.githubusercontent.com/phpmyadmin/scripts/master/demo/sql/world_borders.sql'));"
php -r "file_put_contents('/tmp/opengis.sql', file_get_contents('https://raw.githubusercontent.com/phpmyadmin/scripts/master/demo/sql/opengis.sql'));"
php -r "file_put_contents('/tmp/sakila-schema.sql', file_get_contents('https://raw.githubusercontent.com/phpmyadmin/scripts/master/demo/sql/sakila-db/sakila-schema.sql'));"
php -r "file_put_contents('/tmp/sakila-data.sql', file_get_contents('https://raw.githubusercontent.com/phpmyadmin/scripts/master/demo/sql/sakila-db/sakila-data.sql'));"
# Inject the data
mysql -uroot -ppublic public < /tmp/world.sql
mysql -uroot -ppublic public < /tmp/world_borders.sql
mysql -uroot -ppublic public < /tmp/opengis.sql
mysql -uroot -ppublic public < /tmp/sakila-schema.sql
mysql -uroot -ppublic public < /tmp/sakila-data.sql
# Cleanup
rm /tmp/*.sql
Clone this wiki locally