Operating System Ubuntu

How to Install Joomla 6 on Ubuntu 26.04 LTS with Apache, MySQL and PHP

Install Joomla 6 on Ubuntu 26.04 LTS (or 24.04) with Apache, MySQL and PHP, from packages to the web installer and first update.

This guide installs Joomla 6 on Ubuntu 26.04 LTS with Apache, MySQL and PHP from the Ubuntu archive, and ends with a working site and administrator login. The same steps work on Ubuntu 24.04 LTS; the differences are called out where they matter. Ubuntu 16.04 is long past its standard support period and its PHP 7.0 cannot run any supported Joomla release, so start from a current LTS.

Requirements

  • A server with Ubuntu 26.04 LTS (or 24.04 LTS) and a user with sudo rights.
  • A domain name pointing to the server, example.com in the examples. An IP address works for a test.

Joomla 6 has these minimums, and both Ubuntu releases meet them with stock packages:

ComponentJoomla 6 minimumJoomla 6 recommendedUbuntu 26.04Ubuntu 24.04
PHP8.3.08.48.58.3
MySQL8.0.138.48.48.0
Apache2.42.42.42.4

Joomla supports PHP 8.5 from version 6.0.2 onwards, so the PHP that ships with Ubuntu 26.04 is fine for the current 6.x release. MariaDB (10.4 or newer) and PostgreSQL (12 or newer) are also supported if you prefer them to MySQL.

Step 1: Install Apache, MySQL and PHP

sudo apt update
sudo apt install apache2 mysql-server php libapache2-mod-php php-mysql php-xml php-gd php-mbstring php-zip php-intl php-curl unzip

The unversioned package names install the default PHP of the release (8.5 on 26.04, 8.3 on 24.04). They cover the modules Joomla requires (json, simplexml, dom, zlib, gd and a MySQL driver) plus mbstring, which it recommends. JSON support is built into PHP 8, so there is no separate package for it, and the mcrypt extension that older tutorials install no longer exists.

Enable the rewrite module, which Joomla needs for search-engine-friendly URLs:

sudo a2enmod rewrite

Joomla asks for a PHP memory limit of at least 256 MB. Check the version number in the path with php -v, then edit the Apache PHP configuration:

sudo nano /etc/php/8.5/apache2/php.ini

Set these values (use 8.3 in the path on Ubuntu 24.04):

memory_limit = 256M
upload_max_filesize = 32M
post_max_size = 32M

Step 2: Create the database

On Ubuntu, the MySQL root account authenticates through the system socket, so sudo mysql opens an administrative shell without a password:

sudo mysql

Create a database and a dedicated user for Joomla. Replace the password with your own:

CREATE DATABASE joomla CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'joomla'@'localhost' IDENTIFIED BY 'use-a-long-random-password';
GRANT ALL PRIVILEGES ON joomla.* TO 'joomla'@'localhost';
EXIT;

You can also run sudo mysql_secure_installation to remove the anonymous accounts and the test database.

Step 3: Download Joomla

Get the address of the current Full Package ZIP from downloads.joomla.org. At the time of writing that is Joomla 6.2.0:

cd /tmp
wget -O joomla.zip "https://downloads.joomla.org/cms/joomla6/6-2-0/Joomla_6-2-0-Stable-Full_Package.zip?format=zip"

Unpack it into its own document root and hand the files to the web server user:

sudo mkdir -p /var/www/joomla
sudo unzip -q joomla.zip -d /var/www/joomla
sudo chown -R www-data:www-data /var/www/joomla

Activate the .htaccess file that ships with Joomla:

sudo -u www-data cp /var/www/joomla/htaccess.txt /var/www/joomla/.htaccess

Step 4: Configure the Apache virtual host

Create /etc/apache2/sites-available/joomla.conf:

<VirtualHost *:80>
    ServerName example.com
    ServerAlias www.example.com
    DocumentRoot /var/www/joomla

    <Directory /var/www/joomla>
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/joomla_error.log
    CustomLog ${APACHE_LOG_DIR}/joomla_access.log combined
</VirtualHost>

AllowOverride All is what makes Apache read Joomla's .htaccess. Enable the site, disable the default one, and restart Apache so that the PHP settings and the rewrite module take effect:

sudo a2ensite joomla
sudo a2dissite 000-default
sudo apache2ctl configtest
sudo systemctl restart apache2

If ufw is active, allow web traffic:

sudo ufw allow "Apache Full"

Before you create the administrator account, it is worth adding HTTPS so the password is not sent in clear text: sudo apt install certbot python3-certbot-apache and sudo certbot --apache -d example.com -d www.example.com obtain and install a Let's Encrypt certificate.

Step 5: Run the web installer

Open https://example.com/ in a browser. The Joomla installer starts automatically:

  1. Choose the language and enter the site name.
  2. Enter the login data for the Super User: real name, username, a strong password and an e-mail address.
  3. Enter the database connection: type MySQLi, host localhost, username joomla, the password from step 2 and database name joomla. Keep the randomly generated table prefix.
  4. Click Install Joomla.

When the installer finishes, it offers to install additional languages and links to the site and to the administrator area at https://example.com/administrator/. Log in there with the Super User account.

Step 6: Check and tidy up

The installer normally removes its own installation directory. Confirm that it is gone and that the configuration file exists:

ls /var/www/joomla/installation
ls -l /var/www/joomla/configuration.php

If the directory is still there, delete it with sudo rm -rf /var/www/joomla/installation; Joomla refuses to run a site while it is present. In the administrator area, open System > System Information and review the PHP and directory-permission tabs, then switch on Search Engine Friendly URLs and Use URL Rewriting under System > Global Configuration.

Keeping Joomla updated

Joomla updates itself from the administrator area under System > Update > Joomla; extensions have their own update screen next to it. Take a backup of /var/www/joomla and a database dump before each core update:

sudo mysqldump joomla | gzip > ~/joomla-$(date +%F).sql.gz

Operating-system packages (Apache, PHP, MySQL) are updated separately with sudo apt update && sudo apt upgrade.

Frequently asked questions

Should I still install Joomla 5 or Joomla 3?

Not for a new site. Joomla 6 is the current major version, the 5.4 line received its last bugfix release in October 2026, and Joomla 3 is far out of support. Extensions and templates written for Joomla 3 do not run on 6 without being updated, so check your extensions before migrating an old site.

Why do article URLs return 404 after I enable URL rewriting?

Either .htaccess is missing, mod_rewrite is not enabled, or the virtual host does not have AllowOverride All for the document root. Check all three, then restart Apache.

The installer asks me to delete a file before it continues. Why?

That is a safeguard that appears when the database host is not localhost: Joomla creates a randomly named file in the installation directory and asks you to remove it to prove that you control the server. Delete the named file over SSH and click the install button again.

Can I use Nginx instead of Apache?

Yes. Joomla supports Nginx with PHP-FPM, but it does not read .htaccess there, so URL rewriting is configured with a try_files $uri $uri/ /index.php?$args; rule in the server block instead.

Share story:

Continue reading other guides on How VPS.