How to Install Joomla with LAMP on AlmaLinux 8

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

Install Joomla with LAMP Stack on AlmaLinux 8 and finish with a Joomla 6.1.4 site served by Apache, MariaDB 10.11, PHP 8.4, and HTTPS. Allow about 20 minutes on a fresh AlmaLinux 8.10 VPS, including the browser-based setup.

Prerequisites

  • A fully updated AlmaLinux 8.10 server with at least 2 GB of RAM and 10 GB of free disk space.
  • Root access or a sudo-enabled account connected over SSH. The commands below use sudo where required.
  • A public IPv4 address and a domain such as YOUR_DOMAIN pointing to SERVER_IP; ports 80 and 443 must be reachable.
  • A long database password, a separate Joomla Super User password, and an email address for TLS renewal notices.
  • A VPSLake Linux VPS with root access is suitable for this Apache and MariaDB installation.

Joomla 6 requires PHP 8.3 or newer and supports MariaDB 10.4 or newer. This guide selects PHP 8.4 from Remi and MariaDB 10.11 from AlmaLinux 8.10’s application stream; review Joomla’s technical requirements before a future major-version upgrade.

Step 1: Install the LAMP packages and enable the services

AlmaLinux 8 uses DNF and firewalld. The extra repositories provide a maintained PHP stream while the MariaDB 10.11 stream meets Joomla’s database requirement.

sudo dnf update -y
sudo dnf install -y dnf-plugins-core
sudo dnf config-manager --set-enabled powertools
sudo dnf install -y epel-release
sudo dnf install -y https://rpms.remirepo.net/enterprise/remi-release-8.rpm
sudo dnf module reset php -y
sudo dnf module install php:remi-8.4 -y
sudo dnf module install mariadb:10.11 -y
sudo dnf install -y httpd mariadb-server firewalld php-cli php-common 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

Allow SSH and web traffic, but leave MariaDB private because Joomla will connect locally.

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 firewalld

PHP should report version 8.4, followed by three active lines:

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

Step 2: Secure MariaDB and create the Joomla database

The hardening script removes anonymous accounts and test data before you give Joomla its own database credentials.

sudo mariadb-secure-installation

Remove anonymous users, disallow remote root login, remove the test database, and reload the privilege tables when prompted. The exact root-password questions depend on how the package was initialized, so follow the prompts rather than assuming a fixed answer sequence.

Create a UTF-8 database and a local-only account. Replace YOUR_DB_PASSWORD with a unique password before executing this block.

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';"

The final command should return one row named joomla. Keep the database password for the web installer, and do not add port 3306 to firewalld.

Step 3: Download Joomla and prepare SELinux-safe permissions

The official full package contains the web installer. Apache needs read access to the application and write access only to Joomla’s configuration, cache, media, and temporary directories.

cd /tmp
curl -fL -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 {} +

SELinux stays enabled. Label the site as web content, then mark only the required paths writable by Apache.

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: Create the Apache virtual host

This virtual host maps your domain to Joomla and allows the .htaccess file to provide clean URLs. Replace YOUR_DOMAIN and ADMIN_EMAIL in the block before running it.

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 rewrite_module
sudo systemctl reload httpd

Syntax OK and rewrite_module (shared) confirm that Apache accepted the file. If DNS is not ready, curl -I http://SERVER_IP/ should still return an HTTP response from Apache.

Step 5: Issue a Let’s Encrypt certificate

HTTPS protects the Joomla Super User password and database credentials entered in the browser. Wait until YOUR_DOMAIN resolves to this VPS and port 80 is reachable before starting the HTTP-01 challenge.

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

Replace ADMIN_EMAIL with a monitored address. Certbot adds the TLS virtual host and redirects HTTP to HTTPS; the dry run should report a successful simulated renewal.

Step 6: Finish the Joomla browser installation

The web wizard writes the site configuration and creates Joomla’s tables. Open https://YOUR_DOMAIN/ and use these values on the database page:

  • 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

Continue with a site name, email address, and a unique Super User name and password. Joomla should complete the installation and remove its temporary installation directory. The administrator login is at https://YOUR_DOMAIN/administrator.

After the wizard succeeds, make the generated configuration file read-only to Apache while retaining its group-readable label.

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 semanage fcontext -a -t httpd_sys_content_t '/var/www/joomla/configuration.php'
sudo restorecon -v /var/www/joomla/configuration.php

Verify the Joomla LAMP installation

These checks confirm the services, Apache syntax, PHP extensions, database, generated configuration, and public HTTPS response.

sudo systemctl is-active httpd mariadb firewalld
sudo apachectl configtest
php -m | grep -Ei 'dom|gd|mbstring|mysqli|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/

You should see three active lines, Syntax OK, the required PHP modules, a joomla database row, configuration.php-present, and an HTTP 200 response or a normal Joomla redirect.

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

Troubleshooting

No matching module streams for php:remi-8.4

The Remi or EPEL repository is missing, or DNF has stale metadata. Re-enable the AlmaLinux 8 dependency repository, refresh metadata, and select the stream again.

sudo dnf config-manager --set-enabled powertools
sudo dnf clean all
sudo dnf makecache
sudo dnf module reset php -y
sudo dnf module install php:remi-8.4 -y

Unknown database or Joomla cannot connect to MariaDB

The installer values must match the account created in Step 2. Check that the database exists, use localhost as the host, and recreate the grant if the password was mistyped.

sudo mariadb -e "SHOW DATABASES LIKE 'joomla';"
sudo mariadb -e "SHOW GRANTS FOR 'joomla_user'@'localhost';"

Do not use 127.0.0.1 unless you intentionally configure a TCP connection; localhost lets the PHP client use the local MariaDB socket.

403 Forbidden or 500 Internal Server Error

A wrong DocumentRoot, missing AllowOverride All, or an SELinux label mismatch commonly causes this pair of errors. Inspect Apache’s log and restore the expected contexts instead of disabling SELinux.

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 httpd

Certbot reports a failed HTTP-01 challenge

The domain may still point to another address, or an upstream firewall may block port 80. Confirm public DNS, then check the local firewalld services and HTTP response before retrying.

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

  • Keep configuration.php owned by root:apache with mode 0640, and back up the site files and database before updates.
  • In Joomla administrator, enable core-update notifications and remove extensions you no longer maintain.
  • Keep MariaDB on the local socket and leave port 3306 closed in firewalld.
  • Use VPSLake’s SSH hardening generator after confirming that your normal SSH account and an alternate login path work.

FAQ

Can Joomla 6 use AlmaLinux 8’s default PHP stream?

Do not assume it can. Joomla 6 needs PHP 8.3 or newer, so this guide switches the server to Remi’s PHP 8.4 stream instead of relying on an older base stream.

Why does this guide use MariaDB 10.11?

Joomla 6 supports MariaDB 10.4 and newer. AlmaLinux 8.10 provides a MariaDB 10.11 application stream, giving a supported database version without adding a separate database vendor repository.

Do I need a domain before installing Joomla?

You can inspect Apache over the server IP, but a domain is needed for a trusted Let’s Encrypt certificate. Point the DNS record to the VPS before entering real administrator credentials or publishing the site.

Where do I log in after the installation?

Open https://YOUR_DOMAIN/administrator and use the Super User account created in the browser wizard. The MariaDB username is only for Joomla’s database connection and is not the administrator login.

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

Dedicated Server for Minecraft Network: Specs and Cost

Next Article

How to Install Joomla with LAMP on AlmaLinux 9

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 ✨