How to Install Joomla with LAMP on Rocky Linux 8

Install Joomla with LAMP Stack on Rocky Linux 8 using PHP 8.4, MariaDB 10.11, Apache, firewalld, SELinux, and secure HTTPS in about 20 minutes.
A polished server rack, web application panel, database cylinder, and orange-blue light trails in a dark navy data center.

Install Joomla with LAMP Stack on Rocky Linux 8 and you will have a Joomla 6.1.4 website behind Apache, MariaDB 10.11, PHP 8.4, and HTTPS. Reserve roughly 20 minutes for a clean VPS, including the final setup screens.

Prerequisites

  • Rocky Linux 8.10, the supported final minor release, with at least 2 GB of RAM and 10 GB of free disk space.
  • An SSH connection as root or as an account with sudo rights; leave this session open while you change network rules.
  • A public IPv4 address and YOUR_DOMAIN resolving to SERVER_IP; the web server must be reachable on ports 80 and 443.
  • A unique database secret, a different Joomla Super User password, and an email address that can receive renewal notices.
  • A VPSLake Linux VPS with root access is suitable for this Apache and MariaDB deployment.

Joomla 6 needs PHP 8.3 or later, MariaDB 10.4 or later, and a 256 MB PHP memory limit. Rocky 8.10 supplies MariaDB 10.11, but its older built-in PHP stream is not enough, so the commands select Remi PHP 8.4; consult Joomla’s official technical requirements when planning later upgrades.

Step 1: Build the Rocky 8 web stack

The package choices matter on Rocky 8: enable PowerTools and Remi first, then select PHP 8.4 and the 10.11 MariaDB module before installing Apache and PHP-FPM.

sudo dnf upgrade -y
sudo dnf install -y dnf-plugins-core epel-release
sudo dnf config-manager --set-enabled powertools
sudo dnf install -y https://rpms.remirepo.net/enterprise/remi-release-8.rpm
sudo dnf module reset php -y
sudo dnf module enable php:remi-8.4 -y
sudo dnf module reset mariadb -y
sudo dnf module enable mariadb:10.11 -y
sudo dnf install -y httpd mariadb-server firewalld php php-cli php-common php-fpm php-gd php-intl php-mbstring php-mysqlnd php-opcache php-xml php-zip unzip curl policycoreutils-python-utils certbot python3-certbot-apache mod_ssl
sudo tee /etc/php.d/90-joomla.ini > /dev/null <<'PHP'
memory_limit = 256M
upload_max_filesize = 32M
post_max_size = 32M
max_execution_time = 60
PHP
sudo systemctl enable --now firewalld httpd mariadb php-fpm

Open only the services needed from outside the VPS. Joomla talks to MariaDB over the local Unix socket, so there is no reason to publish port 3306.

sudo firewall-cmd --permanent --zone=public --add-service=ssh
sudo firewall-cmd --permanent --zone=public --add-service=http
sudo firewall-cmd --permanent --zone=public --add-service=https
sudo firewall-cmd --reload
php -v
sudo systemctl is-active httpd mariadb php-fpm firewalld

The version check should start with PHP 8.4, followed by four active results:

PHP 8.4.x (cli) ...
active
active
active
active

Step 2: Create a private Joomla database

Run MariaDB’s security wizard before creating application credentials; it removes the default accounts and sample database that should not remain on a public VPS.

sudo mariadb-secure-installation

Accept removal of anonymous accounts and the test database, disable remote root login, and reload the privilege tables. The prompts depend on how the package was initialized, so follow the choices shown by your server.

Give Joomla its own UTF-8 database and a least-privilege local login. Substitute a long random value for YOUR_DB_PASSWORD before executing the SQL.

sudo mariadb <<'SQL'
CREATE DATABASE joomla CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'joomla_user'@'localhost' IDENTIFIED BY 'YOUR_DB_PASSWORD';
GRANT ALL PRIVILEGES ON joomla.* TO 'joomla_user'@'localhost';
FLUSH PRIVILEGES;
SQL
sudo mariadb -e "SHOW DATABASES LIKE 'joomla';"

Seeing joomla in the result confirms that the database exists. Save the password for Step 6; the firewall should continue to deny external MariaDB connections.

Step 3: Put the Joomla files in place

The full archive includes the installer and the application tree. The ownership layout below lets Apache read most files while limiting write access to the directories Joomla uses for runtime data.

The official Joomla download page lists Joomla 6.1.4. Fetch the full package over HTTPS, unpack it under /var/www, and create the clean-URL file:

cd /tmp
curl -fL --proto '=https' --tlsv1.2 -o Joomla_6-1-4-Stable-Full_Package.zip 'https://downloads.joomla.org/cms/joomla6/6-1-4/Joomla_6-1-4-Stable-Full_Package.zip?format=zip'
sudo mkdir -p /var/www/joomla
sudo unzip -q Joomla_6-1-4-Stable-Full_Package.zip -d /var/www/joomla
sudo cp /var/www/joomla/htaccess.txt /var/www/joomla/.htaccess
sudo chown -R root:apache /var/www/joomla
sudo find /var/www/joomla -type d -exec chmod 0750 {} +
sudo find /var/www/joomla -type f -exec chmod 0640 {} +
sudo install -o apache -g apache -m 0660 /dev/null /var/www/joomla/configuration.php
sudo mkdir -p /var/www/joomla/cache /var/www/joomla/administrator/cache /var/www/joomla/images /var/www/joomla/media /var/www/joomla/tmp /var/www/joomla/administrator/logs
sudo chown -R apache:apache /var/www/joomla/cache /var/www/joomla/administrator/cache /var/www/joomla/images /var/www/joomla/media /var/www/joomla/tmp /var/www/joomla/administrator/logs
sudo find /var/www/joomla/cache /var/www/joomla/administrator/cache /var/www/joomla/images /var/www/joomla/media /var/www/joomla/tmp /var/www/joomla/administrator/logs -type d -exec chmod 0770 {} +
sudo find /var/www/joomla/cache /var/www/joomla/administrator/cache /var/www/joomla/images /var/www/joomla/media /var/www/joomla/tmp /var/www/joomla/administrator/logs -type f -exec chmod 0660 {} +

Do not switch SELinux off to make the installer work. Store persistent file-context rules so Apache can read the tree and write only to the prepared runtime locations.

sudo semanage fcontext -a -t httpd_sys_content_t '/var/www/joomla(/.*)?'
sudo semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/joomla/configuration.php'
sudo semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/joomla/(cache|administrator/cache|images|media|tmp|administrator/logs)(/.*)?'
sudo restorecon -RFv /var/www/joomla

Step 4: Give Apache a Joomla vhost

The vhost makes the domain the site name, points Apache at Joomla’s document root, and allows the .htaccess rewrite rules. Replace both YOUR_DOMAIN and ADMIN_EMAIL in the heredoc first.

sudo tee /etc/httpd/conf.d/joomla.conf > /dev/null <<'APACHE'
<VirtualHost *:80>
    ServerName YOUR_DOMAIN
    ServerAdmin ADMIN_EMAIL
    DocumentRoot /var/www/joomla

    <Directory /var/www/joomla>
        Options -Indexes +FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

    DirectoryIndex index.php index.html
    ErrorLog /var/log/httpd/joomla-error.log
    CustomLog /var/log/httpd/joomla-access.log combined
</VirtualHost>
APACHE
sudo apachectl configtest
sudo apachectl -M | grep -E 'rewrite|proxy_fcgi'
sudo systemctl reload httpd

Look for Syntax OK, rewrite_module, and proxy_fcgi_module. Before DNS is live, curl -I http://SERVER_IP/ is enough to prove that Apache is listening on port 80.

Step 5: Add the Let’s Encrypt certificate

The browser will send the Super User and database credentials, so finish the certificate step before using the installer. The HTTP-01 check can succeed only after YOUR_DOMAIN points here and port 80 is reachable from the internet.

sudo certbot --apache --redirect --agree-tos --no-eff-email -m ADMIN_EMAIL -d YOUR_DOMAIN
sudo certbot renew --dry-run

Use a monitored address for ADMIN_EMAIL. Certbot creates the TLS vhost and HTTP redirect, while renew --dry-run checks the future renewal path without replacing the live certificate.

Step 6: Finish the browser installation

Open https://YOUR_DOMAIN/ once the certificate is active. The Joomla wizard will create the configuration file and tables; on its database screen, use:

  • Database type: MySQLi
  • Database host: localhost
  • Database name: joomla
  • Username: joomla_user
  • Password: the value used for YOUR_DB_PASSWORD
  • Table prefix: keep the generated value

Complete the site name and administrator email fields, then choose a non-obvious Super User name and password. When the success screen appears, sign in at https://YOUR_DOMAIN/administrator and confirm that the installer directory has been removed.

Once the wizard has written the file, make configuration.php readable but no longer writable by the web process. The dedicated runtime directories remain writable for uploads, caches, logs, and temporary data.

sudo chown root:apache /var/www/joomla/configuration.php
sudo chmod 0640 /var/www/joomla/configuration.php
sudo semanage fcontext -d '/var/www/joomla/configuration.php' 2>/dev/null || true
sudo restorecon -v /var/www/joomla/configuration.php

Verify the finished Joomla site

Use the following checklist from SSH, then load the public and administrator URLs in a browser. It checks the daemons, rewrite configuration, PHP extensions, database, generated file, and TLS endpoint.

sudo systemctl is-active httpd mariadb php-fpm firewalld
sudo apachectl configtest
php -m | grep -Ei 'dom|gd|mbstring|mysqli|mysqlnd|pdo_mysql|SimpleXML|xml|zip'
sudo mariadb -e "SHOW DATABASES LIKE 'joomla';"
test -f /var/www/joomla/configuration.php && echo configuration.php-present
curl -fsSI https://YOUR_DOMAIN/

Success means four services are active, Apache returns Syntax OK, the requested modules appear, the database query returns joomla, and the HTTPS request returns 200 or an expected Joomla redirect.

active
active
active
active
Syntax OK
configuration.php-present
HTTP/2 200

Troubleshooting

No matching module streams for php:remi-8.4

This usually means the EL8 repositories were not enabled in the expected order, or DNF is using old metadata. Refresh PowerTools and the Remi module, then install the extensions again.

sudo dnf config-manager --set-enabled powertools
sudo dnf clean all
sudo dnf makecache
sudo dnf module reset php -y
sudo dnf module enable php:remi-8.4 -y
sudo dnf install -y php php-fpm php-intl php-mbstring php-mysqlnd php-xml php-zip
sudo systemctl restart php-fpm httpd

Joomla reports Unable to connect to the Database

Joomla must use the exact database name, username, and password created earlier. Enter localhost as the host and test the account interactively so its password does not land in shell history.

sudo mariadb -e "SHOW GRANTS FOR 'joomla_user'@'localhost';"
mariadb -u joomla_user -p -h localhost joomla -e 'SELECT 1;'

If no grant is shown, recreate the account with the intended password. A local credential problem is not a reason to expose MariaDB on port 3306.

403 Forbidden or 500 Internal Server Error

Check the path and execution chain before changing permissions broadly. A typo in DocumentRoot, a missing AllowOverride All, stopped PHP-FPM, or an incorrect SELinux context can produce either response.

sudo tail -n 40 /var/log/httpd/joomla-error.log
sudo apachectl -S
sudo apachectl configtest
sudo restorecon -RFv /var/www/joomla
sudo systemctl restart php-fpm httpd

Certbot fails the HTTP-01 challenge

The challenge server must reach this VPS over ordinary HTTP. If the DNS record is stale or another firewall blocks port 80, the certificate request will fail even when the local Apache configuration is valid.

sudo firewall-cmd --zone=public --list-services
curl -I http://YOUR_DOMAIN/
sudo certbot --apache --redirect --agree-tos --no-eff-email -m ADMIN_EMAIL -d YOUR_DOMAIN

Hardening

  • Treat configuration.php as a secret: retain root:apache ownership and 0640, and take a database backup before core or extension changes.
  • Keep the database socket-only and leave 3306 absent from the public firewall.
  • Turn on Joomla update notices, uninstall extensions you no longer maintain, and avoid using an obvious administrator username.
  • After testing a second SSH login path, use VPSLake’s SSH hardening generator to create a safer SSH baseline.

FAQ

Is Joomla 6 compatible with Rocky Linux 8?

Yes. The important part is running Rocky 8.10 and replacing the older PHP stream with PHP 8.4 from Remi; Joomla 6 will not meet its PHP requirement on the original Rocky 8 default.

What MariaDB release should I select on Rocky Linux 8?

Choose Rocky 8.10’s MariaDB 10.11 module. It clears Joomla’s 10.4 minimum and avoids accidentally retaining an older stream on a server that was installed before the final Rocky 8 minor release.

Can I start with only the VPS IP address?

You can use http://SERVER_IP/ to test Apache, but a normal Let’s Encrypt certificate requires a public DNS name. Point the hostname to the VPS before running Certbot and publishing the site.

Which URL opens the Joomla control panel?

Use https://YOUR_DOMAIN/administrator after setup. Log in with the Super User credentials from the browser wizard, not the MariaDB credentials used by the application.

Samrat Ghosh
Written by

Samrat Ghosh

Founder & Infrastructure Engineer

Samrat Ghosh is the founder of VPSLake, where he builds and runs the remote desktop and VPS hosting infrastructure the company is built on. He writes hands-on guides about RDP, Windows Server, VPS management and secure remote access - the practical documentation he wishes had…

Previous Article

5 Best SSD Nodes Alternatives in 2026

Next Article

Self-Hosted RustDesk Server on a VPS: Ports, Size and Cost

Write a Comment

Leave a Comment

Your email address will not be published. Required fields are marked *

Subscribe to our Newsletter

Subscribe to our email newsletter to get the latest posts delivered right to your email.
Pure inspiration, zero spam ✨