phpMyAdmin is a web-based interface used for managing MySQL and MariaDB databases. It allows database administrators to perform tasks such as managing databases, running queries, and managing user permissions through an easy-to-use web interface. Installing phpMyAdmin on Ubuntu or Debian systems involves configuring the web server and the necessary dependencies such as Apache and PHP.
The installation process is straightforward using the apt package manager. It automatically installs related packages like php-mysql and mysql-client, though the MySQL or MariaDB server must be installed separately. The setup also includes configuration steps to connect phpMyAdmin with your database and set up secure credentials.
This guide is applicable for Ubuntu and other Debian-based systems. The process covers the basic installation of phpMyAdmin, with optional steps for additional configuration depending on your system setup and requirements.
$ sudo apt update Get:1 http://archive.ubuntu.com/ubuntu jammy InRelease [5284 B] Get:2 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [7432 B] Get:3 http://security.ubuntu.com/ubuntu jammy-security InRelease [7688 B] Fetched 25.4 kB in 2s (12.7 kB/s) Reading package lists... Done
$ sudo apt install --assume-yes phpmyadmin Reading package lists... Done Building dependency tree... Done The following additional packages will be installed: apache2 apache2-bin apache2-data php php-mysql 0 upgraded, 5 newly installed, 0 to remove. Need to get 7.6 MB of archives. After this operation, 42.1 MB of additional disk space will be used.
Use <tab> to navigate and select either Apache2 or your installed web server.
Select Yes when prompted to configure the database for phpMyAdmin automatically.
Enter a secure password that you will use to access phpMyAdmin from the web.
This is the password of your MySQL or MariaDB server's root account.
$ sudo systemctl restart apache2
Apache configuration file:
/etc/apache2/conf-enabled/phpmyadmin.conf
phpMyAdmin configuration file:
/etc/phpmyadmin/config.inc.php
$ curl 127.0.0.1/phpmyadmin
This guide is tested on Ubuntu:
| Version | Code Name |
|---|---|
| 22.04 LTS | Jammy Jellyfish |
| 23.10 | Mantic Minotaur |
| 24.04 LTS | Noble Numbat |