Install Apache
sudo apt install apache2
Install and configure MySQL
Install MySQL
sudo apt install mysql-server
sudo mysql_secure_installation
sudo service mysql restart
Connect to the server
sudo mysql -u root
Once you're logged in, you can create a new database, a new user and grant privileges. Replace your_database, your_user and your_password with what you want to use.
CREATE DATABASE your_database;
CREATE USER 'your_user'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON your_database.* TO 'your_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Install PHP and required modules
Ubuntu 24.04 php package installs php8.3, which is the recommended version by Joomla requirements for Joomla 5.x:
sudo apt install php
Acouring to the Joomla requirements, for Joomla 5.x you need to install these PHP modules - json, simplexml, dom, zlib, gd, mysqlnd or pdo_mysql or pdo_pgsql:
sudo apt install php-json php-xml php-zip php-gd php-mysql
sudo service apache2 restart
Install Joomla
At the time of writing this, the latest version of Joomla is 5.1 and all my examples are for it.
By default your Apache webserver public directory is /var/www/html, so go there and remove the default index.html:
cd /var/www/html
sudo rm index.html
Download Joomla from https://downloads.joomla.org/:
cd /var/www/html
sudo wget https://downloads.joomla.org/cms/joomla5/5-1-0/Joomla_5-1-0-Stable-Full_Package.zip
Extract the files. You may need to install unzip.
sudo apt install unzip
cd /var/www/html
sudo unzip Joomla_5-1-0-Stable-Full_Package.zip
sudo rm Joomla_5-1-0-Stable-Full_Package.zip
Change the ownership of /var/www/html.
sudo chown -R www-data:www-data /var/www/html
Finish the installation by opening the Joomla Installer. It should be accessible by opening http://your_server_ip_address/. For example http://192.168.0.244/ if your server IP address is 192.168.0.244.