How to Install phpMyAdmin on Ubuntu 24.04 Cloud Servers

2025-03-14 By Nathan 1375 Views linux ubunut phpmyadmin
0 reviews

phpMyAdmin is a popular web-based tool for managing MySQL and MariaDB databases. It provides an easy-to-use graphical interface, allowing users to create, modify, and manage databases, users, and tables efficiently.


In Ubuntu 24.04, installing phpMyAdmin requires setting up a web server, installing MySQL (or MariaDB), and configuring phpMyAdmin properly. This guide covers step-by-step instructions to install and configure phpMyAdmin on an Ubuntu 24.04 system.


Prerequisites

  • Ubuntu 24.04 Server installed (without a desktop environment).
  • A user account with sudo privileges or root privileges.
  • Once installed, phpMyAdmin allows database administration through a user-friendly web interface, making it easier to manage databases compared to using the MySQL command line.


A. Setting up the MYSQL Database server

The below steps should be performed to set up the MYSQL Database server and setting up the Database and user.


  1. Update the repository of the latest Ubuntu release.

    # apt update
    

    ubuntu24phpmyadmin1

  2. Install MySQL server if it's not installed.

    # apt install mysql-server -y
    

    ubuntu24phpmyadmin2

  3. Log in to the MySQL once installation is done.

    # mysql
    
  4. Create a sample Database.

    # mysql> CREATE DATABASE <db-name>;
    

    ubuntu24phpmyadmin3

  5. Create a Database User, and then assign to the Database.

    mysql> CREATE USER '<dbadmin>'@'localhost' IDENTIFIED BY 'DBPASSWORD';
    

    ubuntu24phpmyadmin4

  6. Assign full privileges to the database.

    mysql> GRANT ALL PRIVILEGES ON <db-name>.* TO '<dbadmin>'@'localhost';
    
  7. Flush the privileges.

    # mysql> FLUSH PRIVILEGES;
    
  8. Once done, it is safe to exit the Database prompt.

    # mysql> EXIT;
    

    ubuntu24phpmyadmin5


B. Installing phpMyAdmin


  1. Update the APT package and repository.

    # apt update
    

    ubuntu24phpmyadmin6

  2. Install PHP and all the dependent extensions.

    # apt install php php-mysql php-mbstring php-json php-xml php-curl php-zip php-common -y
    

    ubuntu24phpmyadmin7

  3. Install phpMyAdmin.

    # apt install phpmyadmin -y
    

    ubuntu24phpmyadmin8


    To automatically set the the web server, press SPACE to select apache2, and then press ENTER to confirm your selection.

    ubuntu24phpmyadmin9


    Do you want to configure the database for phpMyAdmin using dbconfig-common?

    => Keep Yes, selected and press ENTER to set up the MySQL database.

    ubuntu24phpmyadmin10


    Enter a strong password for the phpMyAdmin database and press ENTER to confirm. Then, re-enter the password and press ENTER to apply the changes.

    ubuntu24phpmyadmin11

  4. To verify the phpMyAdmin is installed successfully, can check with following command:

    # dpkg -l | awk '/phpmyadmin / {print}'
    


    NOTE: phpMyAdmin comes with a default Apache virtual host configuration file that serves the /phpmyadmin endpoint using your server's IP address or domain.

  5. To Enable the phpMyAdmin virtual host configuration using the a2enconf command.

    # a2enconf phpmyadmin.conf
    

    ubuntu24phpmyadmin12


  1. Open a web browser, navigate to the /phpmyadmin endpoint using your server's IP address or domain name.

    http://your_server_ip/phpmyadmin
    


    If every step worked fine, you will get the below screen:

    ubuntu24phpmyadmin13

    ubuntu24phpmyadmin14


Related Tutorials

What do you think about this article?

Rate this article
LayerStack Promotion
Need assistance?

Try this guide to receive free bundled services at signup on a new free account.

Sign Up

Your Feedback Is Important

We hope you’ll give the new products and updates a try. If you have an idea for improving our products or want to vote on other user ideas so they get prioritized, please submit your feedback on our Community platform. And if you have any questions, please feel free to ask in the Community or contact our Technical Support team.