Whether you’re a beginner or a professional looking for a CMS (content management system) to quickly and easily set up a new website, Joomla is the ideal solution for your needs.
Joomla is an open-source and free forever CMS, written in PHP, and supports MySQL/MariaDB and PostgreSQL as a backend. You don’t need coding knowledge to host your website with Joomla.
With Joomla, you can create stunning corporate websites or portals, online applications, small business websites, online magazines, newspapers, and publications, e-commerce and online reservations, and government, and non-profit websites or portals. Joomla powers nearly 2 million active websites around the world.
Some of the key features
- Build in SEO support
- Multilingual functionality
- Text filtering
- Custom fields
- Build in SMTP and caching support
- Modules
- Access Control Lists (ACL)
In this tutorial, you will learn how to install Joomla with Nginx on Ubuntu 24.04 LTS.
Prerequisites
- A system running Ubuntu 24.04
- A sudo user or root password configured
Step 1: System Update
Before starting the installation, it is recommended to update the Ubuntu base system by executing the below command:
sudo apt update -y && sudo apt upgrade -y
Step 2: Install Nginx
Now, install the nginx web server using the command below:
sudo apt install nginx -y
Next, start the Nginx service, enable it at system boot time, and check the status of Nginx using the below commands:
sudo systemctl start nginx
sudo systemctl enable nginx
sudo systemctl status nginx
After installing and ensuring the web server is running, proceed to the next step.
Step 3: Install PHP and PHP-FPM
In this article, we are going to install Joomla 5, hence we are going to install the recommended PHP 8.3 with the necessary PHP modules by running the following command:
sudo apt install php-json php8.3 php8.3-mysql php8.3-cgi php8.3-fpm php8.3-cli php8.3-curl php8.3-gd php8.3-imap php8.3-mbstring php8.3-intl php8.3-apcu php8.3-common php8.3-bcmath php8.3-xml php8.3-dom php8.3-pgsql php8.3-zip wget, unzip -y
Next, check php8.3-fpm service status and enable it at system reboot by running the following command:
sudo systemctl status php8.3-fpm
sudo systemctl enable php8.3-fpm
Step 4: Install and Configure PostgreSQL for Joomla
With Joomla 5 PostgreSQL 16.0 is recommended, execute the below command to install the latest PostgreSQL.
sudo apt install postgresql -y
Once, the database is installed, check the PostgreSQL service status, and enable the service at system startup.
sudo systemctl start postgresql
sudo systemctl enable postgresql
sudo systemctl status postgresql
Next, you need to configure the database for Joomla, to do so run the below command in the terminal:
sudo -u postgres psql
Once, you execute the above command, you will be logged into the PostgreSQL shell. Create a Joomla database and user with the required permission by running the command below:
CREATE DATABASE joomla_database;
CREATE USER joomla_user WITH PASSWORD 'database_password';
GRANT ALL PRIVILEGES ON DATABASE joomla_database TO joomla_user;
\q
Output:
sohan@ubuntu:~$ sudo -u postgres psql
psql (16.3 (Ubuntu 16.3-0ubuntu0.24.04.1))
Type "help" for help.
postgres=# CREATE DATABASE joomla_database;
CREATE DATABASE
postgres=# CREATE USER joomla_user WITH PASSWORD 'database_password';
CREATE ROLE
postgres=# GRANT ALL PRIVILEGES ON DATABASE joomla_database TO joomla_user;
GRANT
postgres=# \q
sohan@ubuntu:~$
Step 5: Download and Install Joomla CMS
Once, the database is configured, download the latest Joomla CMS by running the following command:
wget https://downloads.joomla.org/cms/joomla5/5-1-2/Joomla_5-1-2-Stable-Full_Package.zip
Once the package is downloaded, unzip that zip file in the Nginx root directory.
sudo unzip Joomla_5-1-2-Stable-Full_Package.zip -d /var/www/html/joomla
Now, change the owner and permission of the Joomla directory as shown in the command below:
sudo chown -R www-data:www-data /var/www/html/joomla
sudo sudo chmod -R 755 /var/www/html/joomla/
Step 6: Configure Nginx Virtual Host for Joomla
Create a new Nginx configuration file for Joomla by executing the command below:
sudo vim /etc/nginx/sites-available/joomla.conf
Paste the following lines in it.
server {
listen 80;
server_name example.com; # Set your domain name/IP address
root /var/www/html/joomla; # Your Joomla installation directory path
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php8.3-fpm.sock; # Adjust PHP-FPM version if necessary
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}
Note: you need to replace example.com with your domain name/IP address in the above code.
Once you are done with editing, save and close the file.
Next, create a symlink of joomla.conf file by running the following command:
sudo ln -s /etc/nginx/sites-available/joomla.conf /etc/nginx/sites-enabled/
Test the configuration by running the following command:
sudo nginx -t
Output:
sohan@ubuntu:~$ sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
sohan@ubuntu:~$
To apply the changes, restart the Nginx web server.
sudo systemctl restart nginx
Step 7: Access Joomla CMS Website
Open your web browser and enter the domain or IP address you configured in the Nginx configuration file.
In our example, it is http://example.com
. You will see ‘Select Installation Language‘ page as shown below:
Select your language, then Set up your Joomla site name and click on the “Setup Login Data” button. You will see the below page:
Here, setup your admin username and password and email ID and click on “Setup Database Connection” button. You will see the below page:
Enter the database type as PostgreSQL (PDO), Enter your hostname, your database username, and your database Password, which you have configured easily, and then click on the “Install Joomla” button.
After Joomla is installed, you will see the following page.
Click on “Open Administrator” to access the Joomla login page.
Enter your admin username and password, then click the login button. The next page will display the Joomla Dashboard.
On the Joomla Dashboard, you can customize according to your needs.
Conclusion
Joomla offers great flexibility by providing a range of customization options. Remember to keep Joomla updated for more features, better performance, and security. Feel free to ask if you have any questions.