How to Install phpMyAdmin on CentOS Stream 10

phpMyAdmin is a powerful web-based tool written in PHP that allows users to manage MySQL or MariaDB databases easily. It provides a graphical interface for performing database-related tasks such as creating databases, running queries, and managing users.

In this guide, we will walk through the process of installing phpMyAdmin on CentOS Stream 10.

Prerequisites

Before we begin, ensure you have the following:

  • A system running CentOS Stream 10.
  • root or sudo access to the system.

Once these requirements are met, let’s proceed with the installation and configuration of phpMyAdmin.

Install Apache Web Server

Apache is required to serve phpMyAdmin. Install and enable it with:

dnf install httpd -y

Output:

[root@server ~]# sudo dnf install httpd -y
Last metadata expiration check: 0:13:51 ago on Fri 21 Feb 2025 08:37:43 AM CST.
Dependencies resolved.
=============================================================================================================================================================================================
 Package                                             Architecture                            Version                                        Repository                                  Size
=============================================================================================================================================================================================
Installing:
 httpd                                               x86_64                                  2.4.63-1.el10                                  appstream                                   49 k
Installing dependencies:
 centos-logos-httpd                                  noarch                                  100.2-2.el10                                   appstream                                  855 k
Installing weak dependencies:
 mod_http2                                           x86_64                                  2.0.29-2.el10                                  appstream                                  166 k
 mod_lua                                             x86_64                                  2.4.63-1.el10                                  appstream                                   60 k

Transaction Summary
=============================================================================================================================================================================================
Install  4 Packages

Total download size: 1.1 M
Installed size: 2.0 M
Downloading Packages:
(1/4): httpd-2.4.63-1.el10.x86_64.rpm                                                                                                                        986 kB/s |  49 kB     00:00
(2/4): mod_http2-2.0.29-2.el10.x86_64.rpm                                                                                                                    2.7 MB/s | 166 kB     00:00
(3/4): mod_lua-2.4.63-1.el10.x86_64.rpm                                                                                                                      1.3 MB/s |  60 kB     00:00
(4/4): centos-logos-httpd-100.2-2.el10.noarch.rpm                                                                                                            4.1 MB/s | 855 kB     00:00
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                        2.6 MB/s | 1.1 MB     00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                     1/1
  Installing       : mod_lua-2.4.63-1.el10.x86_64                                                                                                                                        1/4
  Installing       : mod_http2-2.0.29-2.el10.x86_64                                                                                                                                      2/4
  Installing       : centos-logos-httpd-100.2-2.el10.noarch                                                                                                                              3/4
  Installing       : httpd-2.4.63-1.el10.x86_64                                                                                                                                          4/4
  Running scriptlet: httpd-2.4.63-1.el10.x86_64                                                                                                                                          4/4

Installed:
  centos-logos-httpd-100.2-2.el10.noarch                httpd-2.4.63-1.el10.x86_64                mod_http2-2.0.29-2.el10.x86_64                mod_lua-2.4.63-1.el10.x86_64

Complete!

Enable and start Apache:

systemctl enable --now httpd
systemctl status httpd

Output:

[root@server ~]# sudo systemctl enable --now httpd
sudo systemctl status httpd
Created symlink '/etc/systemd/system/multi-user.target.wants/httpd.service' → '/usr/lib/systemd/system/httpd.service'.
● httpd.service - The Apache HTTP Server
     Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; preset: disabled)
    Drop-In: /etc/systemd/system/httpd.service.d
             └─php-fpm.conf
     Active: active (running) since Fri 2025-02-21 09:00:06 CST; 69ms ago
 Invocation: 07a6403e70884e60a1217f290956e808
       Docs: man:httpd.service(8)
   Main PID: 6155 (httpd)
     Status: "Started, listening on: port 80"
      Tasks: 177 (limit: 23166)
     Memory: 13.9M (peak: 14.3M)
        CPU: 149ms
     CGroup: /system.slice/httpd.service
             ├─6155 /usr/sbin/httpd -DFOREGROUND
             ├─6163 /usr/sbin/httpd -DFOREGROUND
             ├─6164 /usr/sbin/httpd -DFOREGROUND
             ├─6165 /usr/sbin/httpd -DFOREGROUND
             └─6166 /usr/sbin/httpd -DFOREGROUND

Feb 21 09:00:06 server systemd[1]: Starting httpd.service - The Apache HTTP Server...
Feb 21 09:00:06 server (httpd)[6155]: httpd.service: Referenced but unset environment variable evaluates to an empty string: OPTIONS
Feb 21 09:00:06 server httpd[6155]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::5652:ff:fe8d:5a6a%ens3. Set the 'ServerName' directiv>
Feb 21 09:00:06 server httpd[6155]: Server configured, listening on: port 80
Feb 21 09:00:06 server systemd[1]: Started httpd.service - The Apache HTTP Server.

Install MariaDB Server

MariaDB is an open-source relational database management system. Follow these steps to install and start MariaDB:

dnf install mariadb-server mariadb -y

Output:

Installing: mariadb-server mariadb
Installed: mariadb-server-10.x.x mariadb-10.x.x
Complete!

Start and enable MariaDB:

systemctl start mariadb
systemctl enable mariadb
systemctl status mariadb

Output:

● mariadb.service - MariaDB 10.x database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2025-02-20 12:34:56 IST; 10s ago

Install phpMyAdmin

Enable EPEL Repository

phpMyAdmin is available in the EPEL (Extra Packages for Enterprise Linux) repository. To enable it, run the following commands:

dnf config-manager --set-enabled crb
dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
dnf install https://dl.fedoraproject.org/pub/epel/epel-next-release-latest-9.noarch.rpm

Output:

Installing epel-release-latest-9.noarch.rpm
Complete!

Install phpMyAdmin

Once the repository is enabled, install phpMyAdmin with:

dnf install phpmyadmin -y

Output:

Installing: phpmyadmin
Installed: phpMyAdmin-5.x.x
Complete!

Restart Apache (HTTPD)

After installation, restart the Apache web server to apply the changes:

systemctl restart httpd

Output:

● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2025-02-20 12:40:12 IST; 5s ago

Configure phpMyAdmin

To allow remote access to phpMyAdmin, we need to modify the configuration file:

vi /etc/httpd/conf.d/phpMyAdmin.conf

Find the following section and add Require all granted below Require local:

# phpMyAdmin configuration
Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin

<Directory /usr/share/phpMyAdmin/>
   AddDefaultCharset UTF-8
   Require local
   Require all granted
</Directory>

<Directory /usr/share/phpMyAdmin/setup/>
   Require local
</Directory>

Save and exit the file (Esc key, then :wq! and Enter).

Configure Firewall

To allow access to the phpMyAdmin web interface, update the firewall rules:

firewall-cmd --add-service=http --permanent
firewall-cmd --add-service=https --permanent
firewall-cmd --reload

Output:

success
success
success

Restart Apache and Verify

Restart Apache to apply the configuration changes:

systemctl restart httpd
systemctl status httpd

Output:

● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2025-02-20 12:45:30 IST; 3s ago

Access phpMyAdmin

Now, open a web browser and navigate to:

http://your-server-IP/phpmyadmin

Note: Replace your-server-IP with the actual server IP or domain name. You should see the phpMyAdmin login page.

Conclusion

You have successfully installed and configured phpMyAdmin on CentOS Stream 10. You can now use it to manage your databases efficiently.

For additional features and security configurations, consider setting up SSL and restricting access to phpMyAdmin only from trusted IPs.


💡 Need a reliable VPS? Check out our plans starting at just $5/month with 24/7 in-house customer support!


CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME for 10% off!

1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month

Available Locations: LAX | MIA | ATL | FRA | AMS