Skip to content
William Desportes edited this page Apr 19, 2024 · 58 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) - closed 07/2023 (outdated packages still available)
  • 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.
  • 23.10 - ⬆️ Mantic not a LTS, use the PPA for jammy.
  • 24.04 - ✅ LTS noble (last update: TODO) - closes XX/YY

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 is PHP 8.2 required ?

phpmyadmin (4:5.2.1+dfsg-3) unstable; urgency=medium

  The phpMyAdmin package now requires PHP 8.2 to run,
  this is the reflection of packaging complexities.
  This will affect Debian packages and Ubuntu packages.
  In 05/2023 the requirement for PHP 8.0+ was added to Ubuntu Jammy.
  As of 04/2024, PHP 8.2 is now required.

  Let me explain this to you:

    Packages out of the scope of phpMyAdmin ship versions only compatible
    with newer PHP versions and drop polyfills for older ones.

    In a Debian version, the code of vendors is split into sub-packages
    that each packaging team manages.
    As a mater of fact security fixing is easier and you receive updates
    from Debian security. Rather than waiting for phpMyAdmin to make
    a new version that would include the vendor security fixed code.

    Because of this packaging method the reality is split.
    There is a Debian/Ubuntu reality with patches for Debian/Ubuntu
    and the one from pure composer source code without any patch
    that phpMyAdmin provides on it's website.

    If you download the phpMyAdmin version from the website the PHP
    version requirement will be different (the vendors are in the ZIP).

  I hope you better understand why PHP 8.2 is required, to match the
  version shipped by Debian.
  The officially required PHP version for all packages in Debian.

  If you have to maintain a legacy PHP version that is different from
  the version shipped with Debian, the solutions are the following:

   - Install multiple PHP-FPM versions
   - Upgrade your existing code to a newer PHP version
   - apt-get remove this package and install from the phpMyAdmin website

  References:
    - https://bugs.launchpad.net/bugs/2016016
    - https://github.com/phpmyadmin/phpmyadmin/issues/17503
    - https://github.com/phpmyadmin/phpmyadmin/issues/19092

 -- William Desportes <williamdes@wdes.fr>  Thu, 18 Apr 2024 00:41:31 +0200

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