phpMyAdmin is a popular web-based tool for managing MySQL or MariaDB databases. This guide will walk you through the steps to install phpMyAdmin on an AlmaLinux server.
Note that this guide is for Almalinux 9.x. If you have Almalinux 8.x, please check this guide.
Prerequisites #
- AlmaLinux server: A system running AlmaLinux (9.x).
- Root or Sudo privileges: You need administrative access to install packages and configure the web server.
- LAMP Stack (Linux, Apache, MySQL/MariaDB, PHP): Ensure that you have a working Apache, MySQL/MariaDB, and PHP installation on your server.
- EPEL Repository: The Extra Packages for Enterprise Linux (EPEL) repository must be enabled.
Step 1: Update the System #
- Before installing any new software, it’s important to update your package list.
sudo dnf update
- If you run into an issue with GPG Keys when running the above command, please see this on how to fix it. You will basically run the command below to fix it, then re-run the update command above.
rpm --import https://repo.almalinux.org/almalinux/RPM-GPG-KEY-AlmaLinux

Step 2: Install EPEL and REMI Repositories #
- The
phpMyAdmin
package is not available in the default AlmaLinux repositories. You will need to install the EPEL (Extra Packages for Enterprise Linux) and REMI repositories. - To install EPEL repo, run the command below on Almalinux 8 terminal.
dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm

- To install REMI, run this command:
dnf install https://rpms.remirepo.net/enterprise/remi-release-9.rpm

- Once installed, confirm that the EPEL and REMI repositories are enabled:
sudo dnf repolist

3. Install fedora-autoloader package #
- Next, install fedora-autoloader package using the command below:
dnf install https://rpms.remirepo.net/enterprise/9/remi/x86_64/php-fedora-autoloader-1.0.1-2.el9.remi.noarch.rpm

4. Install phpMyAdmin #
- Now you can install phpMyAdmin by running the following:
dnf --enablerepo=remi install phpMyAdmin

5. Restart Apache Web Server #
- To enable new configurations, restart the Apache:
systemctl restart httpd
6. Modify configurations file to allow Access from the IP #
- By default access to phpMyAdmin only from the local IP is enabled. However, you can edit the configuration file and enable access from the specific IP.
- Using your favourite editot like vim or nano, open the phpMyAdmin configuration file as below;
vi /etc/httpd/conf.d/phpMyAdmin.conf
- Find these lines as shown below
<Directory /usr/share/phpMyAdmin/>
AddDefaultCharset UTF-8
Require local
</Directory>
<Directory /usr/share/phpMyAdmin/setup/>
Require local
</Directory>

- Then add the the line below, replace your_workstation_ip with your network IP, to allow phpMyAdmin Access from your IP
Require ip your_workstation_ip
<Directory /usr/share/phpMyAdmin/>
AddDefaultCharset UTF-8
Require ip 1.1.1.1
Require local
</Directory>
<Directory /usr/share/phpMyAdmin/setup/>
Require ip 1.1.1.1
Require local
</Directory>
* To allow access from all IPs, add the line below instead.
Require all granted
<Directory /usr/share/phpMyAdmin/>
AddDefaultCharset UTF-8
Require all granted
Require local
</Directory>
<Directory /usr/share/phpMyAdmin/setup/>
Require all granted
Require local
</Directory>
- Save changes then restart apache service
systemctl restart httpd
7. Access phpMyAdmin #
- To open phpMyAdmin, open your web browser and enter the URL in the following format:
- Replace server_ip with your server IP.
https://server_ip/phpmyadmin

- In the resulting phpMyAdmin log in interface above, you will enter MySQL user credentials to log in and manage your databases:
- You can check this guide on how to install MariaDB on Almalinux