Skip to content

How to install PhpMyAdmin, Apache2 and MySQL on your Linux VPS

Instructions for installing PhpMyAdmin, Apache2 and MySQL on a Linux VPS.

Install Apache2

  1. Update packages
    Open a terminal window on your server and run the following command:

    bash
    sudo apt update && apt install apache2 -y
    sudo apt update && apt install apache2 -y

Install MySQL

  1. Install MySQL
    Enter the following command to start the installation of MySQL:

    bash
    sudo apt install mysql-server -y
    sudo apt install mysql-server -y
  2. Set password
    During the installation you will be asked to set a password for the MySQL root user. Enter a secure password and save it in a safe place.

Install PhpMyAdmin

  1. Install PhpMyAdmin
    Enter the following command to start the installation of PhpMyAdmin:

    bash
    sudo apt install phpmyadmin -y
    sudo apt install phpmyadmin -y
  2. Select web server
    During the installation you will be asked to select a web server. Select Apache2 and press the Enter key.

  3. Set admin password
    During the installation you will be asked to set a password for the PhpMyAdmin administrator account. Enter a secure password and save it in a safe place.

  4. Test installation
    When you are finished, open your web browser and enter the address http://<server-ip>/phpmyadmin/. You should be prompted to log in with your PhpMyAdmin administrator account.

Configure PhpMyAdmin

  1. Open configuration
    Open the file config.inc.php, which is located in the directory /etc/phpmyadmin/:

    bash
    nano /etc/phpmyadmin/config.inc.php
    nano /etc/phpmyadmin/config.inc.php
  2. Change Blowfish Secret
    Change the line $cfg['blowfish_secret'] to a random string that is at least 32 characters long.

INFO

Save the input with Ctrl + O and close the window with Ctrl + X.