How to Install Joomla on Ubuntu, Debian, AlmaLinux, and Rocky Linux
Introduction
Joomla is a popular open-source content management system (CMS) used for building websites and online applications. It is user-friendly, flexible, and highly customizable. This guide will show you how to install Joomla on Ubuntu, Debian, AlmaLinux, and Rocky Linux.
Prerequisites
Before installing Joomla, ensure you have the following:
-
A server running Ubuntu 22.04/20.04, Debian 11/10, AlmaLinux 9/8, or Rocky Linux 9/8.
-
Root or sudo access.
-
A LAMP or LEMP stack installed (Apache/Nginx, MySQL/MariaDB, PHP).
-
Git and unzip installed.
Step 1: Update Your System
Update your package lists and upgrade installed packages:
sudo apt update && sudo apt upgrade -y # For Ubuntu/Debian
sudo dnf update -y # For AlmaLinux/Rocky
Step 2: Install Required Packages
Install Apache/Nginx, MariaDB, PHP, and other dependencies:
# For Ubuntu/Debian
sudo apt install apache2 mariadb-server php php-cli php-mbstring php-xml php-curl php-zip unzip git -y
# For AlmaLinux/Rocky
sudo dnf install httpd mariadb-server php php-cli php-mbstring php-xml php-curl php-zip unzip git -y
Start and enable services:
sudo systemctl enable --now apache2 mariadb # Ubuntu/Debian
sudo systemctl enable --now httpd mariadb # AlmaLinux/Rocky
Step 3: Configure Database
Secure your MariaDB installation:
sudo mysql_secure_installation
Create a database and user for Joomla:
sudo mysql -u root -p
CREATE DATABASE joomla;
CREATE USER 'joomla_user'@'localhost' IDENTIFIED BY 'secure_password';
GRANT ALL PRIVILEGES ON joomla.* TO 'joomla_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Step 4: Download and Set Up Joomla
Navigate to the web root and download Joomla:
cd /var/www/
wget https://downloads.joomla.org/cms/joomla4/latest -O joomla.zip
sudo unzip joomla.zip -d /var/www/html/joomla
Set correct permissions:
sudo chown -R www-data:www-data /var/www/html/joomla
sudo chmod -R 755 /var/www/html/joomla
Step 5: Configure Apache/Nginx
Apache Virtual Host Configuration
Create a new virtual host file:
sudo nano /etc/apache2/sites-available/joomla.conf
Add the following content:
<VirtualHost *:80>
ServerAdmin admin@example.com
DocumentRoot /var/www/html/joomla
ServerName your-domain.com
<Directory /var/www/html/joomla>
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Enable the site and restart Apache:
sudo a2ensite joomla.conf
sudo systemctl restart apache2
Nginx Configuration
Create a new Nginx configuration file:
sudo nano /etc/nginx/conf.d/joomla.conf
Add the following content:
server {
listen 80;
server_name your-domain.com;
root /var/www/html/joomla;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass unix:/run/php/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
Restart Nginx:
sudo systemctl restart nginx
Step 6: Finalize Joomla Installation
-
Open your browser and visit
http://your-domain.com
. -
Follow the on-screen setup wizard.
-
Enter the database details configured earlier.
-
Complete the installation and log in.
Conclusion
You have successfully installed Joomla on Ubuntu, Debian, AlmaLinux, or Rocky Linux. Your CMS is now ready to use. To enhance security, enable SSL with Let’s Encrypt and configure a firewall.