Skip to content
Follow
CMS

How to Install Joomla with Nginx Support on Ubuntu 24.04

Richard
Written by
Richard
May 31, 2024 Updated Oct 13, 2026 10 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 on Ubuntu 24.04 gives you a fast website platform that copes well with heavy visitor traffic. Joomla is a free content management system for building websites. Nginx is a lightweight web server that uses little memory on Linux.

Advertisement

Joomla also needs a database and PHP to run, so this guide installs four things in order: Nginx, MariaDB, PHP-FPM and Joomla itself. It then adds a free Let’s Encrypt SSL certificate. Follow the steps in order, because each one depends on the one before it.

Before you start, you need an Ubuntu 24.04 server and a user account that can run commands with sudo. If you want HTTPS at the end, you also need a domain name pointing at the server.

⚡ Quick Answer

Install Joomla on Ubuntu 24.04 with Nginx by running sudo apt update, then sudo apt install nginx, then sudo apt install mariadb-server, followed by PHP-FPM and Joomla itself. Enable each service with sudo systemctl enable so it starts after a reboot. Nginx serves pages, PHP-FPM runs Joomla, and MariaDB stores your content.

Advertisement

Install Nginx HTTP server on Ubuntu Linux

Nginx is the web server that receives visitor requests and hands the PHP work over to PHP-FPM. To install it on Ubuntu 24.04, open a terminal and run the update command, then the Nginx installation command. This installs the core web server Joomla needs.

Run the commands in the block below to install Nginx. Updating the package list first makes sure Ubuntu pulls the current version from its repositories.

  1. Open the terminal. On a desktop, press Ctrl+Alt+T. On a remote server, connect over SSH.
  2. Run the commands from the block below, one after the other.
  3. Type your password if sudo asks for it, and answer Y if apt asks you to confirm. When the prompt returns without errors, Nginx is installed.
🐧Bash / Shell
sudo apt update
sudo apt install nginx

On Ubuntu, the Nginx package normally starts the service as soon as it is installed. The commands below let you start and stop Nginx yourself, and enable it so it starts every time the server boots. Run the enable command even if the service is already running, or Nginx will be down after the next reboot.

Advertisement
🐧Bash / Shell
sudo systemctl stop nginx
sudo systemctl start nginx
sudo systemctl enable nginx

Next, check that Nginx is serving pages. Open a web browser and go to the server's localhost address or its IP address, as shown below.

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, the Nginx HTTP server is installed and working.

📝Good to KnowIf the page does not load from another computer, a firewall is the most likely cause.

If UFW is active on the server, allow HTTP and HTTPS traffic through it, then try again.

Advertisement

There is more detail on installing Nginx on Ubuntu in the post linked below.

How to install Nginx on Ubuntu

Install MariaDB database server on Ubuntu Linux

MariaDB stores your Joomla content, user accounts and settings. To install it on Ubuntu 24.04, open a terminal and run the package installation command. This sets up the database server Joomla needs.

The steps below install MariaDB, start it, and check that it works.

Advertisement

Open the Ubuntu terminal and run the commands below to install the MariaDB database server. Confirm with Y if apt asks.

🐧Bash / Shell
sudo apt update
sudo apt install mariadb-server

Once MariaDB is installed, use the commands below to stop it, start it, and enable it so it starts automatically when the server boots. As with Nginx, enabling the service is what keeps your site working after a reboot. If Joomla ever shows a database connection error, check that this service is running first.

🐧Bash / Shell
sudo systemctl stop mariadb
sudo systemctl start mariadb
sudo systemctl enable mariadb

Run the commands below to check that MariaDB installed correctly.

🐧Bash / Shell
sudo mariadb

These commands log you into the MariaDB console and show a message similar to the one below.

Advertisement
💻Code
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 confirms the server is installed and answering connections.

Additional help on installing MariaDB:

Create a Joomla database

Joomla needs its own database for its tables and configuration. To create one, log into the MariaDB shell from your terminal, then run the SQL commands that create the database and a user with a strong password.

This database holds all of Joomla's content and data, so the installation cannot finish without it.

Advertisement

In this guide the database is named joomladb and the user account is named joomladbuser. You can pick other names, but you must then use those same names in the Joomla installer later.

The joomladbuser account gets full access to the joomladb database, so Joomla can create tables and manage all of its site data. It has no need for access to any other database on the server.

You can do all of this with the commands below.

First, log on to the MariaDB database server:

Advertisement
🐧Bash / Shell
sudo mariadb

You should now be at the MariaDB prompt. Run the commands below to finish the job:

💻Code
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
⚠️WarningReplace type_your_password_here with your own password before you run the commands.

Use a long, unique password, and write it down, because you need it again in the Joomla installer. To leave the MariaDB prompt afterwards, type exit.

Install PHP-FPM on Ubuntu Linux

PHP-FPM (FastCGI Process Manager) runs the PHP code that powers Joomla. Nginx cannot run PHP itself, so it passes PHP requests to PHP-FPM. To install PHP-FPM and the extensions Joomla needs on Ubuntu 24.04, run the apt install command in your terminal with all the required modules.

Run the commands below to install PHP. Make sure the install finishes without errors before you move on, because a missing extension can make the Joomla installer fail its pre-installation checks.

🐧Bash / Shell
sudo apt install php-fpm php-intl php-mysql php-curl php-cli php-zip php-gd php-common php-mbstring php-xmlrpc php-sqlite3 php-zip

Additional help on installing PHP:

How to install PHP on Ubuntu Linux

Download Joomla files

Downloading Joomla puts the core website files in your Nginx web root. To do this, use the wget command in your terminal to fetch the archive, extract it, and set the right folder permissions for Nginx.

The commands in the blocks below download Joomla and place it in a new Joomla folder inside the Nginx root directory. Run them in the order shown.

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

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

The last step is to change ownership and permissions. On Ubuntu, Nginx runs as the www-data user, and it needs access to the Joomla files to serve them and to let the installer write its configuration. If you skip this step, the installer will usually complain that it cannot write to a folder.

Joomla releases new versions regularly, so check for the latest one. Get the current download link from the official download page and replace the link in the download command with the new one. Newer versions bring fixes and security updates.

🐧Bash / Shell
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/

With the files in place, configure Nginx to serve the Joomla content. This is done with a server block, which tells Nginx which domain or IP address maps to which folder.

Run the command below to create a Nginx server block file for Joomla. It opens an empty file in a text editor.

🐧Bash / Shell
sudo nano /etc/nginx/sites-available/joomla.conf

Copy the content from the block below and paste it into the server block file. Change the server name in it to your own domain or server IP address.

🐘PHP
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;
}
}

Check that the PHP-FPM version in the configuration file, shown highlighted, matches the version you installed. The version number appears in the PHP-FPM socket path. Ubuntu 24.04 ships PHP 8.3 by default, unless you added another PHP repository. If the version is wrong, visitors will get a 502 Bad Gateway error.

Save the file when you are done.

Nginx only reads server blocks that are linked in the sites-enabled folder, so you must enable yours and then restart Nginx. To enable the server block, run `sudo ln -s /etc/nginx/sites-available/your_domain.conf /etc/nginx/sites-enabled/`. Replace your_domain.conf with the name of the file you created, which is joomla.conf if you followed the SSL section below. Then restart Nginx by running `sudo systemctl restart nginx`.

If Nginx fails to restart, the error message usually points to a typo in the server block file. Fix it and restart again. If you still see the default Welcome to nginx! page afterwards, the default site is answering your requests, so check the server name you set in your file.

🐧Bash / Shell
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 the traffic between your visitors and your Joomla site, so the site loads over HTTPS. To set up Let's Encrypt on Ubuntu 24.04, install Certbot and run its Nginx plugin command. Certbot then secures your server block file at /etc/nginx/sites-available/joomla.conf automatically.

Let's Encrypt only issues certificates for domain names, not bare IP addresses. Before you run Certbot, make sure your domain's DNS record points to this server and that ports 80 and 443 are open.

The post below has more detail 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

When Certbot finishes, the Nginx server block file /etc/nginx/sites-available/joomla.conf is configured for HTTPS by the Certbot Nginx plugin. You do not need to edit it by hand.

Once Nginx has restarted, open your browser and go to the server hostname or IP address set in the Nginx server block. If you set up SSL, use the https:// address.

💻Code
http://joomla.example.com

The Joomla installation wizard should now appear. If it does not, Nginx is not passing the request to PHP correctly, so recheck the PHP-FPM version in your server block.

  1. Select the installation language.
  2. Enter your site name.
  3. Click Next to go to the next page.
Joomla installation language and site name selection
Joomla installation language and site name selection

The next page asks for your administrator login details. This is the account you will use to sign in to the Joomla back end.

  1. Enter your name.
  2. Enter a username.
  3. Enter a strong password.
  4. Enter your email address.
  5. Click Next to proceed.
Joomla account details setup screen
Joomla account details setup screen

The last page is the database configuration. Enter the details you created earlier.

  1. Type the database name, joomladb if you used the name from this guide.
  2. Type the database username and the password you set.
  3. Leave the host name as localhost, because MariaDB runs on the same server.
  4. Click Install Joomla.

The installer takes a minute or so to create the tables. If it reports a database connection error, recheck the name, username and password.

Joomla database connection setup interface
Joomla database connection setup interface

Your new Joomla site is now created and ready to use. You can open the site itself from its main address. To manage it, sign in to the administrator area by adding /administrator to the address, using the account you created in the wizard.

Joomla installation complete confirmation screen
Joomla installation complete confirmation screen

That should do it!

Conclusion:

  • Running Joomla on Ubuntu with Nginx gives you high performance, low memory usage, and a faster, more responsive website.
  • Combining Joomla with Nginx on Ubuntu gives you a more efficient and reliable hosting environment for your site.
  • The setup involves installing the Nginx HTTP server, the MariaDB database server and PHP-FPM on Ubuntu Linux. The Joomla site is then secured with a Let's Encrypt SSL/TLS certificate.
  • The step-by-step guide in this post takes you through installing Joomla with Nginx support on Ubuntu 24.04, from a blank server to a working site.

Have a question about this guide?

Answered by AI from this guide. Good questions may be added to this page — please don't include personal details.

Did this guide fix your problem?

Richard

About the Author

Richard

Tech Writer, IT Professional

Richard is a writer at Geek Rewind who turns complex IT tasks into clear, step-by-step guides. He draws on years of hands-on experience in system administration and enterprise IT operations, focusing on Windows, Linux and WordPress: the problems people actually run into, and the fixes that work. His server and WordPress guides come from systems he runs himself. Richard builds and maintains the platform behind Geek Rewind, from its Ubuntu servers and Nginx configuration to its custom WordPress plugins. Many new tutorials start with readers' questions, and he's always glad to answer them in the comments.

Advertisement

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

Leave a Comment

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