Skip to content
Follow
CMS

How to install Joomla with Nginx support on Ubuntu 24.04

Richard
Written by
Richard
May 31, 2024 Updated Sep 15, 2026 7 min read
How to install Joomla with Apache on Ubuntu 24.04
How to install Joomla with Apache on Ubuntu 24.04

Installing Joomla with Nginx support on Ubuntu 24.04 sets up a fast website platform that handles high visitor traffic without slowing down. Joomla is a free tool for building websites, and Nginx is a speedy web server that runs efficiently on Linux systems.

Advertisement

Pairing these two programs gives you a reliable base to run your site smoothly. Follow the steps below to configure your server from start to finish.

⚡ Quick Answer

Install Nginx and MariaDB using `apt install nginx mariadb-server`. Create a Joomla database and user with `CREATE DATABASE joomladb CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;` and grant privileges. Then, install PHP-FPM to process PHP code for Joomla.

Advertisement

Install Nginx HTTP server on Ubuntu Linux

Nginx is a fast web server that handles visitor traffic for your Joomla site. To install Nginx on Ubuntu 24.04, open your terminal and run the update command followed by the Nginx installation command. This sets up the core web server needed to run Joomla on your Ubuntu system.

To do that, open the Ubuntu terminal and run the commands below to install the Nginx web server.

sudo apt update
sudo apt install nginx

Once Nginx is installed, the commands below can start, stop, and enable the Nginx web server to start automatically when your server boots up.

sudo systemctl stop nginx
sudo systemctl start nginx
sudo systemctl enable nginx

You test that the Nginx web server is running by opening your web browser and browsing to the server’s localhost or IP address.

Advertisement

http://localhost

Nginx default welcome page on Ubuntu 24.04
Nginx default welcome page on Ubuntu 24.04

When you see the Welcome to nginx! page, it means the Nginx HTTP server is successfully installed.

Additional help on installing Nginx on Ubuntu is in the link below.

How to install Nginx on Ubuntu

Advertisement

Install MariaDB database server on Ubuntu Linux

MariaDB stores all your Joomla website content, user accounts, and settings. To install MariaDB on Ubuntu 24.04, open your terminal and run the package installation command. This sets up the database server required to store your Joomla data securely.

To install and use the MariaDB database server, use the instructions below.

Open the Ubuntu terminal and run the commands below to install the MariaDB database server.

sudo apt update
sudo apt install mariadb-server

Once the MariaDB database server is installed, use the commands below to stop, start, and enable the MariaDB server to start automatically when the server boots.

Advertisement
sudo systemctl stop mariadb
sudo systemctl start mariadb
sudo systemctl enable mariadb

Run the following commands to validate and test if the MariaDB database server is installed successfully.

sudo mariadb

Once you run the commands above, it will log you onto the MariaDB console and display a message similar to the one below.

Welcome to the MariaDB monitor.  Commands end with ; or g.
Your MariaDB connection id is 32
Server version: 10.11.2-MariaDB-1 Ubuntu 23.04

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

MariaDB [(none)]> 

The message tells you that the server is installed successfully.

Additional help on installing MariaDB.

Advertisement

Create a Joomla database

A dedicated database holds all your Joomla site tables and configuration data. To create a Joomla database, log into the MariaDB shell from your terminal and run the SQL commands to set up the database and a user with a secure password.

The MySQL database will store all Joomla application content and data, making the MySQL database crucial for the setup process.

As part of the setup, we will create a database named ‘joomladb ‘and a corresponding user account named ‘joomladbuser ‘.

The joomladbuser receives full access to the joomladb database to manage all Joomla website data, ensuring complete control for the administrator.

Advertisement

All the database steps above can be done using the commands below:

But first, log on to the MariaDB database server:

sudo mariadb

Then run the commands below to complete the steps:

CREATE DATABASE joomladb CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
CREATE USER joomladbuser@localhost IDENTIFIED BY 'type_your_password_here';
GRANT ALL ON joomladb.* TO joomladbuser@localhost WITH GRANT OPTION;
FLUSH PRIVILEGES;
exit
⚠️WarningEnsure to replace ‘type_your_password_here‘ with your password.
Advertisement

Install PHP-FPM on Ubuntu Linux

PHP-FPM (Process Manager) runs the PHP code that powers your Joomla website. To install PHP-FPM and the required extensions on Ubuntu 24.04, run the apt install command in your terminal with all the necessary modules for Joomla to function properly.

Run the commands below to install PHP.

sudo apt install php-fpm php-intl php-mysql php-curl php-cli php-zip php-gd php-common php-mbstring php-xmlrpc php-json php-sqlite3 php-zip

Additional help on installing PHP

How to install PHP on Ubuntu Linux

Download Joomla files

Downloading the official Joomla installation files places the core website software in your Nginx web root directory. To download Joomla, use the wget command in your terminal to fetch the archive, extract the files, and set the correct folder permissions for Nginx.

The command block below will download and create a new Joomla folder in the Nginx root directory.

First, create a Joomla folder in the Nginx root directory.

Joomla files download to the `/tmp` directory. After unzipping the Joomla files, move the unzipped content into the Joomla folder you created in the Nginx root directory.

Rest assured, the final step is to change the permissions. This will allow the Nginx web server to safely interact with the files, ensuring a secure environment for your Joomla installation.

💡TipStay up-to-date with Joomla’s latest version.

Get it from the official download page and replace the link with the new version to ensure you benefit from the latest features and security updates.

sudo mkdir -p /var/www/joomla
cd /tmp/
wget https://downloads.joomla.org/cms/joomla5/5-1-1/Joomla_5-1-1-Stable-Full_Package.zip
sudo unzip -d /var/www/joomla Joomla_*.zip
sudo chown -R www-data:www-data /var/www/joomla/

Once you have completed all the above steps, continue below to configure the Nginx web server to serve the Joomla content.

Run the commands below to create a Nginx server block file for Joomla.

sudo nano /etc/nginx/sites-available/joomla.conf

Then, copy and paste the content block below into the Nginx server block.

server {
listen 80;
listen [::]:80;
root /var/www/joomla;
index index.php;
server_name joomla.example.com www.joomla.example.com;

location / {
try_files $uri $uri/ /index.php?$args;
}

# deny running scripts inside writable directories
location ~* /(images|cache|media|logs|tmp)/.*.(php|pl|py|jsp|asp|sh|cgi)$ {
return 403;
error_page 403 /403_error.html;
}

location ~ .php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}

Ensure you're using the correct highlighted version of PHP-FPM in the configuration file.

Save the file when you're done.

The server block configuration file for your website needs to be enabled and then the Nginx server must be restarted. To enable the server block, run the command `sudo ln -s /etc/nginx/sites-available/your_domain.conf /etc/nginx/sites-enabled/` and then restart the Nginx server by running `sudo systemctl restart nginx`.

sudo ln -s /etc/nginx/sites-available/joomla.conf /etc/nginx/sites-enabled/
sudo systemctl restart nginx.service

Setup Let’s Encrypt SSL/TLS for Joomla

An SSL certificate encrypts traffic between your visitors and your Joomla website using HTTPS. To set up Let's Encrypt on Ubuntu 24.04, install Certbot and run the Nginx plugin command to automatically secure your server block file at /etc/nginx/sites-available/joomla.conf.

Please read the post below for additional resources on installing and creating Let’s Encrypt SSL certificates for Nginx.

How to set up Let’s Encrypt SSL certificate for Nginx on Ubuntu Linux

After installing, the Nginx server block file /etc/nginx/sites-available/joomla.conf will automatically be configured with HTTPS, done by the Certbot Nginx plugin.

Once you have restarted the Nginx web server, open your browser and browse to the server hostname or IP address defined in the Nginx server block.

http://joomla.example.com

A Joomla installation wizard will appear. Select the installation language, enter the site name, and go to the next page.

Joomla installation language and site name selection
Joomla installation language and site name selection

Next, enter your name, username, and password for your account, along with your email address, and proceed to the next page.

Joomla account details setup screen
Joomla account details setup screen

On the next page, type in the database name, username, and password created above. Then, click "Install Joomla."

Joomla database connection setup interface
Joomla database connection setup interface

Your new Joomla site should be created and ready to use.

Joomla installation complete confirmation screen
Joomla installation complete confirmation screen

That should do it!

Conclusion:

  • Setting up a Joomla site on Ubuntu with Nginx support provides high performance, low memory usage, and enhanced website responsiveness and speed.
  • Combining Joomla with Nginx on Ubuntu ensures a more optimized and reliable web hosting environment, instilling a sense of security in your online operations.
  • Installation involves setting up a Nginx HTTP server, a MariaDB database server, and PHP-FPM on Ubuntu Linux. The Joomla installation is also secured with Let’s Encrypt SSL/TLS.
  • The step-by-step guide detailed in this post simplifies installing Joomla with Nginx support on Ubuntu 24.04, ensuring a smooth and efficient setup.

Does nginx work on Ubuntu?

Nginx is available in Ubuntu's default repositories. Install it using the apt packaging system. First, update the local package index to access the most recent package listings, then install nginx : sudo apt update.

Was this guide helpful?

Was this helpful?
Richard

About the Author

Richard

Tech Writer, IT Professional

Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.

Advertisement

📚 Related Tutorials

How to Install GNOME Desktop on Ubuntu 24.04
Ubuntu Linux How to Install GNOME Desktop on Ubuntu 24.04
How to Install KDE Desktop on Ubuntu 24.04
Ubuntu Linux How to Install KDE Desktop on Ubuntu 24.04
Install Mautic with Nginx on Ubuntu 24.04
CMS Install Mautic with Nginx on Ubuntu 24.04
Install LibreNMS with Nginx on Ubuntu 24.04
CMS Install LibreNMS with Nginx on Ubuntu 24.04

No comments yet — be the first to share your thoughts!

Leave a Comment

Your email address will not be published. Required fields are marked *