Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Install Joomla on Ubuntu 22.04

Set up Apache, MariaDB and PHP, download Joomla and finish the installation in your browser.

CMS and Apps2 min read4 steps18 screenshots

Step 1: Install Apache

sudo apt update
Updating the system
sudo apt install apache2
Installing Apache

Check that it starts at boot and that it runs:

sudo systemctl is-enabled apache2
Apache is enabled
sudo systemctl status apache2
The Apache status

Open the firewall. Allow SSH first so that you do not lock yourself out:

sudo ufw allow OpenSSH
sudo ufw allow "Apache Full"
Allowing Apache in the firewall
sudo ufw enable
Enabling the firewall
sudo ufw reload
Reloading the firewall
sudo ufw status
The firewall status

Step 2: Install MariaDB

sudo apt install mariadb-server
Installing MariaDB
sudo systemctl is-enabled mariadb
MariaDB is enabled
sudo systemctl status mariadb
The MariaDB status

Secure the install:

sudo mysql_secure_installation
Running mysql_secure_installation

Step 3: Install PHP

sudo apt install php libapache2-mod-php php-mysql php-xml php-mbstring php-curl php-zip php-gd php-intl
Installing PHP

Restart Apache and test PHP:

sudo systemctl restart apache2
sudo nano /var/www/html/phpinfo.php

Add:

<?php
phpinfo();
?>

Open http://your_server_ip/phpinfo.php.

The phpinfo page

Delete this file after the test: sudo rm /var/www/html/phpinfo.php.

Step 4: Create the database

sudo mysql -u root -p
Opening the MariaDB shell
CREATE DATABASE joomla;
CREATE USER 'joomlauser'@'localhost' IDENTIFIED BY 'StrongPassword';
GRANT ALL PRIVILEGES ON joomla.* TO 'joomlauser'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Step 5: Download Joomla

Get the link of the current full package from the Joomla website, and download it:

cd /tmp
wget https://downloads.joomla.org/cms/joomla5/5-1-2/Joomla_5-1-2-Stable-Full_Package.zip
Downloading Joomla

Unzip it into the web folder:

sudo mkdir -p /var/www/html/joomla
sudo unzip Joomla_5-1-2-Stable-Full_Package.zip -d /var/www/html/joomla
Unzipping Joomla

Set the owner:

sudo chown -R www-data:www-data /var/www/html/joomla
sudo chmod -R 755 /var/www/html/joomla

Step 6: Finish in the browser

Open http://your_server_ip/joomla. The Joomla installer starts.

The Joomla installer
  1. Enter the site name and the admin user details.
  2. Enter the database details: type MySQLi, host localhost, the user and password from step 4, and the database name joomla.
  3. Click Install.
  4. When it ends, remove the installation folder if the installer asks for it.

Add an SSL certificate (for example with certbot --apache) before you use the site for real.

Quick recap

  • Install Apache, MariaDB and PHP.
  • Create a database and user.
  • Unzip Joomla into /var/www/html/joomla and run the web installer.