Joomla is a flexible open-source CMS. Running it on a VPS gives you full control over PHP and caching. This guide installs Joomla 5 on a Linux VPS with Nginx, PHP-FPM and MariaDB.
Before you start
- A VPS with 1 GB RAM or more, running Ubuntu 22.04/24.04 or AlmaLinux 9.
- A LEMP stack. See install a LEMP stack.
- A domain pointed at the VPS.
- On cPanel instead? See install Joomla on cPanel.
Install PHP extensions
Joomla 5 needs PHP 8.1 or newer:
sudo apt install php8.3-fpm php8.3-mysql php8.3-xml php8.3-zip php8.3-gd php8.3-intl php8.3-mbstring php8.3-curl unzipCreate the database
sudo mysql -e "CREATE DATABASE joomla CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; CREATE USER 'joomla'@'localhost' IDENTIFIED BY 'StrongPasswordHere'; GRANT ALL ON joomla.* TO 'joomla'@'localhost'; FLUSH PRIVILEGES;"Download Joomla
Download the full package zip from the official Joomla downloads page, then extract it:
sudo mkdir -p /var/www/joomla && sudo unzip /tmp/Joomla_5*-Stable-Full_Package.zip -d /var/www/joomla && sudo chown -R www-data:www-data /var/www/joomlaConfigure Nginx
server {
listen 80;
server_name example.com www.example.com;
root /var/www/joomla;
index index.php;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~* /(administrator/(cache|logs)|cache|logs|tmp)/ {
deny all;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
}
}Enable the site, run sudo nginx -t, reload Nginx and add SSL with Certbot.
Run the installer
- Open
https://example.com. - Set the site name and admin login.
- Choose MySQLi, host
localhost, and the database user and name from above. Keep a random table prefix. - Finish. Joomla 5 removes the installation folder for you; if it remains, delete it.
After installing
- In System → Global Configuration → Site, enable Search Engine Friendly URLs and Use URL Rewriting. The Nginx
try_filesrule makes them work. - Under Server, set Force HTTPS to Entire Site.
- Turn on two-factor authentication for admin accounts.
- Apply Joomla updates promptly from System → Update.
Troubleshooting
- 404 with URL rewriting on: the
try_filesline is missing. - Extension upload fails: raise
upload_max_filesizeand Nginxclient_max_body_size. - Error 0 or blank page: set Error Reporting to Maximum temporarily and read the PHP-FPM log, or see debug a PHP white screen.
FAQ
Does Joomla need .htaccess on Nginx?
No. Nginx ignores .htaccess; the try_files rule does the same job. On Apache or LiteSpeed, rename htaccess.txt to .htaccess.
Which PHP version is best for Joomla 5?
PHP 8.2 or 8.3. Both are supported and faster than 8.1.
Can I upgrade from Joomla 4 to 5 on the VPS?
Yes, with the built-in updater, once your extensions are compatible. Back up the files and database first.
