How to Install Joomla with Apache on Ubuntu 24.04
Installing Joomla with Apache on Ubuntu 24.04 (Noble Numbat) gives you a self-hosted website built on free, open-source software. Joomla is the content management system you use to build and manage pages. Apache is the web server that delivers those pages to visitors.
A working site on this Ubuntu version needs four pieces: the Apache web server, a MariaDB database to store your content, PHP so Apache can run Joomla’s code, and the Joomla files themselves. This guide installs them in that order and finishes with an optional free HTTPS certificate.
Before you start, you need an Ubuntu 24.04 server or desktop, a user account with sudo rights, and an internet connection. A domain name is only required for the HTTPS step at the end.
Install Joomla with Apache on Ubuntu 24.04 by installing four pieces in order: the Apache web server (sudo apt install apache2), the MariaDB database (sudo apt install mariadb-server), PHP to run Joomla’s code, and the Joomla files themselves. Run each install from the Ubuntu terminal with sudo.
Install Apache HTTP server on Ubuntu Linux
Apache is the web server software that listens for requests from browsers and sends back your pages. To install it, open your terminal and run the standard package manager commands. Once it is installed, anyone who can reach your server’s IP address can see the site.
To do that, open the Ubuntu terminal and run the commands below to install the Apache web server. On a desktop, press Ctrl+Alt+T to open a terminal. On a remote server, connect with SSH first. The commands use sudo, so Ubuntu asks for your password. Nothing shows on screen as you type it, which is normal.
sudo apt update
sudo apt install apache2
Once Apache is installed, the commands below can start, stop, and enable the Apache web server. “Enable” means Apache starts automatically every time the server boots, so your site comes back after a reboot. Ubuntu usually starts Apache right after installing it, but running the enable command makes sure it also starts at boot.
sudo systemctl stop apache2
sudo systemctl start apache2
sudo systemctl enable apache2
You can test that the Apache web server is running by opening your web browser and browsing to the server’s localhost or IP address. Use localhost if the browser runs on the same machine as Apache. Otherwise, use the server’s IP address, which is the same one you use to connect over SSH. The address looks like this:
http://localhost

When you see the Apache2 Default Page, it means the Apache HTTP server is successfully installed. The page usually says “It works!” at the top.
Additional help on installing Apache on Ubuntu is in the link below.
Install MariaDB database server on Ubuntu Linux
MariaDB is the database server. Joomla saves its user accounts, articles, menus, and settings there. To install it, use your terminal to download and set up the database software. Ubuntu 24.04 has MariaDB in its default repositories, so you need no extra software sources.
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. As with Apache, the enable command is what keeps the database available after a reboot. Without it, Joomla would show database errors until you started MariaDB by hand.
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. The version number in your message may differ from the example, and that is fine.
Additional help on installing MariaDB.
- How to install MariaDB on Ubuntu Linux
- MariaDB without password prompt
Create a Joomla database
To create a Joomla database, log into the MariaDB command line and run SQL queries. They set up a new empty database and a dedicated user account. This gives Joomla its own private storage space for all your website content, and it keeps Joomla from using the database root account.
The MySQL database serves as the repository for all Joomla application content and data, which is why this step matters in the Joomla setup. MariaDB is a drop-in replacement for MySQL, so Joomla treats it as a MySQL database. You will see “MySQLi” as the database type in the web installer later.
Finally, give the joomladbuser full access to the joomladb database. That user can then create tables and store data in this database, and it has no access to any other database on the server.
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. Each SQL statement ends with a semicolon, and MariaDB should answer each one with a short confirmation. If you get an error instead, read it before you continue, because a typo here causes a connection failure in the installer later.
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
Replace type_your_password_here with your own password before you run the command. Use a long, unique password, and keep the quotation marks around it in the command.
Install PHP on Ubuntu Linux
Joomla is written in PHP, so Apache needs PHP before it can show the site. To install PHP on Ubuntu Linux, run the apt install command along with required modules like php-mysql and libapache2-mod-php. These packages allow your Apache web server to process PHP code and talk to your database. Ubuntu 24.04 ships PHP 8.3, which current Joomla 5 releases support.
Run the commands below to install PHP. Install every module in the list. The Joomla installer runs a pre-installation check, and it flags any missing PHP extension.
sudo apt install php libapache2-mod-php 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
Download Joomla files
To download Joomla files, use the wget command in your terminal to grab the latest installation package directly from the official site. Place these files into your Apache web root directory so the server can display your new website.
The command block below will download and create a new Joomla folder in the Apache root directory. It works in three parts, explained below.
First, create a Joomla folder in the Apache root directory. This folder holds the whole site, and the Apache virtual host will point to it later.
You will download Joomla files into the /tmp directory. That is a temporary location, so the download does not clutter your web folder. After unzipping the Joomla file, you will move the unzipped Joomla content into the Joomla folder you previously created in the Apache root directory.
The last part changes the ownership and permissions. Apache runs as the www-data user on Ubuntu. That user must be able to read the Joomla files and write to them, for example to save the configuration file during installation. If you skip this step, the installer will report that folders are not writable.
Joomla releases new versions regularly, and the link in the commands may be out of date by the time you read this. Get the current link from the official Joomla download page and replace the one in the commands. The latest version has the newest features and security fixes.
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 Apache web server to serve the Joomla content. Out of the box, Apache only shows its default page. A virtual host file tells it which folder and which site name to use for Joomla.
Run the commands below to create an Apache virtual host file for Joomla. The command opens a new, empty file called joomla.conf in a text editor.
sudo nano /etc/apache2/sites-available/joomla.conf
Then, copy and paste the content block below into the Apache server block. Before you save, edit the lines that name your server so they match your own domain name or server IP address. Check that the web root line points to the Joomla folder you created earlier.
<VirtualHost *:80>
ServerName joomla.example.com
ServerAlias www.joomla.example.com
ServerAdmin admin@example.com
DocumentRoot /var/www/joomla
<Directory /var/www/joomla/>
Options FollowSymlinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Save the file. If it opened in nano, press Ctrl+O, then Enter to confirm the file name, then Ctrl+X to exit.
Enable the Apache server block for Joomla by running the sudo a2ensite joomla.conf command. Then restart the Apache server using sudo systemctl restart apache2. This applies the new website configuration and makes your Joomla installation reachable in your web browser. If Apache refuses to restart, the cause is almost always a typo in joomla.conf. Reopen the file and compare it with the block above.
sudo a2ensite joomla.conf
sudo systemctl restart apache2
This step is optional but strongly recommended for any public site.
Setup Let’sLet’sypt SSL/TLS for Joomla
To set up Let’s Encrypt SSL/TLS for Joomla, install the Certbot tool and request a free security certificate for your domain. This encrypts traffic between visitors and your server to keep user data safe, including the administrator password you type at login. Two things must be in place first. Your domain name must point to this server’s public IP address. Ports 80 and 443 must be open. Let’s Encrypt does not issue certificates for a bare IP address.
Please read the post below for additional resources on installing and creating Let’s Encrypt SSL certificates for Apache.
How to set up Let’sLet’sypt SSL certificate for Apache on Ubuntu Linux
After installing, the Apache server block file /etc/apache2/sites-available/joomla.conf will automatically be configured with HTTPS by the Certbot Apache plugin. Certbot may also create a companion file in the same folder for the secure version of the site. Let’s Encrypt certificates are valid for 90 days, and Certbot sets up automatic renewal.
Once you have restarted the Apache web server, open your browser and browse to the server hostname or IP address defined in the Apache server block. If you set up HTTPS, use the https:// address, and the browser should show a padlock.
http://joomla.example.com
A Joomla installation wizard page should appear. Select the installation language, enter the site name and continue to the next page. If you still see the Apache default page instead, the new site is not enabled or Apache has not been restarted. Go back to the virtual host steps.

Next, enter your name, a username and password for your administrator account, and your email address, then continue to the next page. This is the Super User account you will use to log in to the Joomla administrator area. Pick a username that is not “admin” and a strong password.

On the next page, type in the database name, username, and password created above: joomladb, joomladbuser, and the password you chose. Leave the database type as MySQLi and the host name as localhost. Then, click “Install Joomla.” If the connection fails, check that the three values match what you created in MariaDB. The installer also shows any PHP or permission problems it finds.

Your new Joomla site should be created and ready to use. The final page offers buttons to open the site or the administrator area. You can log in to the administrator area at your site address followed by /administrator, using the Super User account you just created.

That should do it!
Conclusion:
- This guide walked you through setting up a Joomla site on an Ubuntu 24.04 server with Apache. You now have a stable, free platform for building and managing your website.
- You installed and configured Apache, MariaDB, and PHP, created a database and user for Joomla, and downloaded the Joomla files into the Apache web root.
- You also learned how to secure your Joomla installation with Let’s Encrypt SSL/TLS certificates.
- With the server in place, you can now create and manage dynamic websites with Joomla on a solid, scalable platform.
- If you have feedback or additional tips, please leave them in the comments section below the article.
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?
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.
No comments yet — be the first to share your thoughts!