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.

Steps to install phpMyAdmin on Ubuntu or Debian:

  1. Update the system package list.
    $ 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
  2. Install phpMyAdmin via the apt package manager.
    $ 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.
  3. Select your preferred web server during installation.

    Use <tab> to navigate and select either Apache2 or your installed web server.

  4. Configure phpMyAdmin to use dbconfig-common.

    Select Yes when prompted to configure the database for phpMyAdmin automatically.

  5. Set a password for phpMyAdmin access.

    Enter a secure password that you will use to access phpMyAdmin from the web.

  6. Enter the MySQL root password.

    This is the password of your MySQL or MariaDB server's root account.

  7. Restart the web server to apply changes.
    $ sudo systemctl restart apache2
  8. Edit configuration files for phpMyAdmin if needed.

    Apache configuration file:

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

    phpMyAdmin configuration file:

    /etc/phpmyadmin/config.inc.php
  9. Access phpMyAdmin via your browser using the server’s IP address or localhost.
    $ 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
Discuss the article:

Comment anonymously. Login not required.