Skip to content

DebianUbuntu

William Desportes edited this page Jan 5, 2023 · 29 revisions
Clone this wiki locally

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:

Ubuntu PPA support

⚠️ Will 5.2 be supported, the answer is yes: soon. Packaging is in progress.

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

Distro list

  • 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.1.4 - 2022-12-17) - 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.1.4 - 2022-05-25) - closes 04/2025
  • 22.10 - kinetic 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

How to install

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

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 !)

# 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

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
# Install PHP for apache2
apt install libapache2-mod-php -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
# 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');"
# 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