Skip to main content

How To Install Joomla

Updated this week

Introduction

Joomla is a free and open source content management system that uses PHP and a backend database, such as MySQL.

In this guide, we will install Joomla on Ubuntu 24.04.

Starting from the system updates and installing the LAMP Server

To perform a system update/upgrade, use:

sudo apt update
sudo apt upgrade

To install LAMP Server, use:

apt install apache2 mysql-server php libapache2-mod-php php-dev php-bcmath php-intl php-soap php-zip php-curl php-mbstring php-mysql php-gd php-xml unzip -y

Installing the Apache service:

systemctl start apache2
systemctl enable apache2

Create a Database

We need to create a database and a Joomla user.

Start by connecting to the MySQL shell:

mysql

Creating a database and a user for Joomla:

CREATE DATABASE joomla;
CREATE USER 'joomla'@'localhost' IDENTIFIED BY 'password';

Grant all the privileges on the Joomla database.

mysql> GRANT ALL ON joomla.* TO 'joomla'@'localhost';

Now we need to flush the privileges and exit from the MySQL shell:

FLUSH PRIVILEGES;
EXIT;

Install Joomla

Visit the Joomla website and download the latest version with the wget command:

wget https://downloads.joomla.org/cms/joomla5/5-3-0/Joomla_5-3-0-Stable-Full_Package.zip

When downloading is completed, unzip the downloaded file to the Apache web root directory:

unzip Joomla_5-3-0-Stable-Full_Package.zip -d /var/www/html/joomla

As well, we need to change the ownership and permissions for the Joomla directory:

chown -R www-data:www-data /var/www/html/joomla/
chmod -R 755 /var/www/html/joomla/

Configure Apache for Joomla

We need to create the Apache virtual host configuration file for Joomla:

nano /etc/apache2/sites-available/joomla.conf

And add the following configuration:

<VirtualHost *:80>  

ServerAdmin [email protected]

ServerName joomla.domain.com
DocumentRoot /var/www/html/joomla

<Directory /var/www/html/joomla/>
Options FollowSymlinks
AllowOverride All
Require all granted
</Directory>

ErrorLog ${APACHE_LOG_DIR}/example.com_error.log
CustomLog ${APACHE_LOG_DIR}/example.com_access.log combined

</VirtualHost>

Save and close the file.

Note: Do not forget to change the server's admin email address, domain, and other settings to yours.

Then, activate the Joomla virtual host:

a2ensite joomla.conf

Restart the Apache service:

systemctl restart apache2

Open your web browser and access Joomla using the URL of your domain name.

Did this answer your question?