Install Joomla with LAMP Stack on Rocky Linux 10 and finish with a Joomla 6 website served by Apache, MariaDB, PHP 8.3, and HTTPS. A fresh VPS takes about 20 minutes, including the browser-based installer.
Prerequisites
- A fully updated Rocky Linux 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. Keep your current SSH session open while changing the firewall.
- A public IPv4 address and
YOUR_DOMAINpointing toSERVER_IP; ports 80 and 443 must be reachable from the internet. - A unique 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 deployment.
Rocky Linux 10 provides PHP 8.3 and MariaDB 10.11 in its standard repositories. Joomla 6 supports PHP 8.3, needs MariaDB 10.4 or newer, and requires modules such as DOM, SimpleXML, GD, and a MySQL driver; see Joomla’s technical requirements before a future major-version change.
Step 1: Install Apache, MariaDB, PHP, and firewalld
Rocky Linux 10 uses DNF and firewalld, while its native PHP package avoids an unnecessary third-party repository for this Joomla version.
sudo dnf upgrade -y
sudo dnf install -y epel-release
sudo dnf install -y httpd mariadb-server firewalld php php-cli php-common php-gd php-intl php-mbstring php-mysqlnd php-opcache php-xml php-zip unzip curl policycoreutils-python-utils mod_ssl certbot python3-certbot-apache
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. MariaDB stays private because Joomla connects through the local socket.
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 begin with 8.3, and all three services should report active:
PHP 8.3.x (cli) ...
active
active
active
Step 2: Harden MariaDB and create a Joomla database
The MariaDB hardening utility removes default accounts and test data before the site receives a dedicated local database user.
sudo mariadb-secure-installation
Remove anonymous users, prevent remote root login, remove the test database, and reload the privilege tables when prompted. The questions differ slightly depending on the package state, so answer them from the current server state.
Create a UTF-8 database and grant access only to a local account. Replace YOUR_DB_PASSWORD with a long password before running the block; do not use the placeholder literally.
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 last command should return a row named joomla. Save the same password for the web installer, and do not open TCP port 3306 in firewalld.
Step 3: Download Joomla and set SELinux-safe permissions
The official full package contains the web installer. Apache needs read access to the application, but only Joomla’s configuration, cache, media, image, log, and temporary directories should be writable.
The official Joomla download page currently lists Joomla 6.1.4. Download that package directly over HTTPS:
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 {} +
Keep SELinux enforcing and make the labels survive a reboot or relabel operation. The general rule marks site files as readable web content; the more specific rule permits writes only to paths Joomla needs during setup and normal operation.
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: Configure the Apache virtual host
This virtual host maps your domain to Joomla and permits its .htaccess rules, which are needed for clean URLs. Replace YOUR_DOMAIN and ADMIN_EMAIL in the heredoc 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 -E 'php|rewrite'
sudo systemctl reload httpd
Syntax OK and the module output confirm that Apache accepted the vhost, PHP, and rewrite support. If DNS is not ready, curl -I http://SERVER_IP/ still checks whether Apache answers on port 80.
Step 5: Enable HTTPS with Let’s Encrypt
TLS protects the Super User password and database credentials entered in the browser. Wait until the domain resolves to this VPS before requesting the certificate.
sudo certbot --apache --redirect --agree-tos --no-eff-email -m ADMIN_EMAIL -d YOUR_DOMAIN
sudo certbot renew --dry-run
Replace ADMIN_EMAIL with an address you monitor. Certbot adds the HTTPS virtual host and redirects HTTP; a successful dry run confirms that renewal can work later.
Step 6: Complete the Joomla browser installer
The wizard writes the site configuration and creates Joomla’s initial tables. Open https://YOUR_DOMAIN/ and enter these values on the database screen:
- 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, administrator email, and a unique Super User name and password. After the success message, sign in at https://YOUR_DOMAIN/administrator; Joomla should remove the temporary installation directory.
Lock the generated configuration file after the wizard finishes. The separate writable directories from Step 3 remain available for cache, uploads, logs, and temporary files.
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 Joomla LAMP installation
Run these checks over SSH, then open both the public site and administrator URL. They validate the services, Apache syntax, required PHP modules, database, configuration file, and HTTPS response.
sudo systemctl is-active httpd mariadb 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/
Expect three active lines, Syntax OK, the listed PHP modules, one joomla database row, configuration.php-present, and an HTTP 200 response or normal Joomla redirect.
active
active
active
Syntax OK
configuration.php-present
HTTP/2 200
Troubleshooting
No match for argument: php-intl or another PHP package
The repository metadata may be stale, or the EPEL package installation did not complete. Refresh DNF metadata and confirm that Rocky’s AppStream can see the PHP packages; do not enable an EL9 or EL8 repository on Rocky Linux 10.
sudo dnf clean all
sudo dnf makecache
sudo dnf repolist
sudo dnf provides '*/intl.so'
sudo dnf install -y php-intl php-mbstring php-mysqlnd php-xml php-zip
Joomla reports Unable to connect to the Database
The installer values must match the local account created in Step 2. Use localhost, not a public hostname, and test the account without putting its password in shell history.
sudo mariadb -e "SHOW GRANTS FOR 'joomla_user'@'localhost';"
mariadb -u joomla_user -p -h localhost joomla -e 'SELECT 1;'
If the grant is missing, rerun the CREATE USER and GRANT statements with the intended password. Do not expose MariaDB on port 3306 just to solve a local connection error.
403 Forbidden or 500 Internal Server Error
A wrong document root, missing AllowOverride All, restrictive file mode, or an SELinux label mismatch commonly causes these responses. Inspect the error log and restore the labels rather than 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 fails the HTTP-01 challenge
The DNS record may still point elsewhere, or port 80 may be blocked by the VPS provider or an upstream firewall. Check the public hostname and the local firewalld rules 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.phpowned byroot:apachewith mode0640, and back up the database before Joomla or extension updates. - Leave MariaDB bound to local access and keep port 3306 closed unless a documented application requirement changes.
- Enable Joomla update notifications, remove unused extensions, and use a unique administrator username and password.
FAQ
Does Rocky Linux 10 include a PHP version Joomla 6 supports?
Yes. Rocky Linux 10 provides PHP 8.3 from AppStream, and Joomla 6 supports PHP 8.3 or newer. PHP 8.4 is recommended upstream, but PHP 8.3 is the native supported choice used here.
Can I install Joomla without a domain name?
You can test the site through http://SERVER_IP/, but Let’s Encrypt cannot issue a normal certificate for a bare server IP. Point a domain to the VPS before running the HTTPS step.
Why is the database host localhost instead of 127.0.0.1?
localhost lets the PHP MySQL driver use MariaDB’s local Unix socket. It avoids a public network path and matches the account created as 'joomla_user'@'localhost'.
Where is the Joomla administrator login?
After installation, visit https://YOUR_DOMAIN/administrator. The browser installer creates the Super User account; use that account rather than the Rocky Linux SSH account.