Technology Encyclopedia Home >How to Install Joomla on a VPS — Full Setup with Nginx and HTTPS

How to Install Joomla on a VPS — Full Setup with Nginx and HTTPS

Joomla sits in an interesting position in the CMS landscape: more structured than WordPress for complex sites, but less developer-intensive than Drupal. It has a loyal user base particularly for multilingual sites — built-in multilingual support is genuinely good and doesn't require third-party plugins.

I set up Joomla for a client who needed a multilingual site with a content workflow that WordPress plugins were struggling to handle cleanly. The deployment process is similar to WordPress but with a few Joomla-specific steps, particularly around the admin directory security warning that shows up on first install.

This guide covers the full setup on Ubuntu 22.04 with Nginx, PHP 8.2, and MySQL.

I run this on Tencent Cloud Lighthouse. Joomla runs comfortably on the 2 vCPU / 4 GB RAM plan. For multilingual sites (one of Joomla's strengths), Lighthouse's multiple data center regions (US, Europe, Singapore, Tokyo, and more) let you choose a server location that minimizes latency for your primary audience. The OrcaTerm browser terminal also makes it easy to run Joomla's CLI tools or check error logs without a local SSH setup.


Table of Contents

  1. What Joomla Is Good For
  2. Prerequisites
  3. Part 1 — Server Setup
  4. Part 2 — Create Database
  5. Part 3 — Download and Configure Joomla
  6. Part 4 — Configure Nginx
  7. Part 5 — Run the Joomla Installer
  8. Part 6 — Enable HTTPS
  9. Part 7 — Post-Installation Security
  10. The Gotcha: Remove the Installation Directory
  11. Useful Joomla Admin Tasks

  • Key Takeaways
  • Use the appropriate Lighthouse application image to skip manual installation steps where available
  • Lighthouse snapshots provide one-click full-server backup before major changes
  • OrcaTerm browser terminal lets you manage the server from any device
  • CBS cloud disk expansion handles growing storage needs without server migration
  • Console-level firewall + UFW = two independent protection layers

What Joomla Is Good For {#why}

Joomla is a strong fit for:

  • Multilingual websites — built-in language management
  • Community portals — user registration, profiles, ACL
  • E-commerce (with VirtueMart extension)
  • Corporate websites with content teams
  • Educational platforms with user roles

For personal blogs, WordPress is simpler. For enterprise content management, Drupal is more powerful. Joomla fits well in between.


Prerequisites {#prerequisites}

Requirement Notes
Cloud server Tencent Cloud Lighthouse Ubuntu 22.04
PHP 8.1+ Joomla 5 requires PHP 8.1 minimum
MySQL 8.0 Or MySQL 5.7+ / MariaDB 10.4+

Part 1 — Server Setup {#part-1}

ssh ubuntu@YOUR_SERVER_IP
sudo apt update && sudo apt upgrade -y

sudo add-apt-repository ppa:ondrej/php -y
sudo apt update

sudo apt install -y nginx php8.2-fpm php8.2-mysql php8.2-xml \
  php8.2-gd php8.2-curl php8.2-mbstring php8.2-zip php8.2-intl \
  php8.2-opcache php8.2-apcu php8.2-bcmath mysql-server unzip

sudo ufw allow ssh
sudo ufw allow 'Nginx Full'
sudo ufw enable

sudo systemctl start mysql && sudo systemctl enable mysql
sudo mysql_secure_installation

Configure PHP limits for Joomla:

sudo nano /etc/php/8.2/fpm/php.ini
memory_limit = 256M
upload_max_filesize = 32M
post_max_size = 32M
max_execution_time = 300
sudo systemctl restart php8.2-fpm

Part 2 — Create Database {#part-2}

sudo mysql
CREATE DATABASE joomla_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'joomla_user'@'localhost' IDENTIFIED BY 'strong_password_here';
GRANT ALL PRIVILEGES ON joomla_db.* TO 'joomla_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Part 3 — Download and Configure Joomla {#part-3}

# Create web directory
sudo mkdir -p /var/www/joomla
sudo chown ubuntu:ubuntu /var/www/joomla

# Download latest Joomla (check joomla.org for current version)
cd /tmp
wget "https://downloads.joomla.org/cms/joomla5/5-2-0/Joomla_5-2-0-Stable-Full_Package.zip"
unzip Joomla_5-2-0-Stable-Full_Package.zip -d /var/www/joomla/

# Set permissions
sudo chown -R www-data:www-data /var/www/joomla
sudo find /var/www/joomla -type d -exec chmod 755 {} \;
sudo find /var/www/joomla -type f -exec chmod 644 {} \;
sudo chmod 644 /var/www/joomla/configuration.php 2>/dev/null || true

Part 4 — Configure Nginx {#part-4}

sudo nano /etc/nginx/sites-available/joomla
server {
    listen 80;
    server_name yourdomain.com www.yourdomain.com;

    root /var/www/joomla;
    index index.php index.html;

    access_log /var/log/nginx/joomla_access.log;
    error_log  /var/log/nginx/joomla_error.log;

    # Joomla SEF URLs
    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    # PHP processing
    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php8.2-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }

    # Protect sensitive directories
    location ~* /(administrator|cache|cli|components|includes|installation|language|layouts|libraries|logs|modules|plugins|tmp) {
        location ~ \.php$ {
            return 403;
        }
    }

    # Deny access to hidden files
    location ~ /\. {
        return 403;
    }

    # Static file caching
    location ~* \.(jpg|jpeg|png|gif|ico|css|js|woff|woff2)$ {
        expires 30d;
        add_header Cache-Control "public, no-transform";
    }

    client_max_body_size 32m;
}
sudo ln -s /etc/nginx/sites-available/joomla /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx

Part 5 — Run the Joomla Installer {#part-5}

Visit http://yourdomain.com — the Joomla web installer appears.

Step 1: Configuration

  • Site name, admin email, admin username and password
  • Site offline: No (for now)

Step 2: Database

  • Database type: MySQLi
  • Hostname: localhost
  • Username: joomla_user
  • Password: your password
  • Database name: joomla_db
  • Table prefix: leave default or set a custom prefix

Step 3: Overview

  • Review settings
  • Click Install

Installation takes about 30 seconds.

Step 4: Remove installation directory

  • Click Remove Installation folder before leaving this page
  • Or do it manually (see Gotcha section)

Part 6 — Enable HTTPS {#part-6}

sudo apt install -y certbot python3-certbot-nginx
sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com

After HTTPS is enabled, configure Joomla to force HTTPS:

  1. Log into Joomla admin: https://yourdomain.com/administrator
  2. System → Global Configuration → Server tab
  3. Force HTTPS: Entire Site
  4. Save

Part 7 — Post-Installation Security {#part-7}

Secure configuration file

sudo chmod 444 /var/www/joomla/configuration.php

Set correct file ownership

sudo chown -R www-data:www-data /var/www/joomla
sudo find /var/www/joomla -type d -exec chmod 755 {} \;
sudo find /var/www/joomla -type f -exec chmod 644 {} \;

Protect the admin panel

Consider adding HTTP Basic Auth to /administrator for an extra layer:

# Create htpasswd file
sudo apt install -y apache2-utils
sudo htpasswd -c /etc/nginx/.htpasswd admin_user

# Add to Nginx config inside the server block:
location /administrator {
    auth_basic "Admin Area";
    auth_basic_user_file /etc/nginx/.htpasswd;
    try_files $uri $uri/ /index.php?$args;
}

The Gotcha: Remove the Installation Directory {#gotcha}

Joomla's installation directory (/installation/) must be removed after setup. If it exists, Joomla shows a warning and may block access until it's removed.

The web installer has a "Remove Installation folder" button on the final screen. If you missed it:

sudo rm -rf /var/www/joomla/installation

Also verify it's gone:

ls /var/www/joomla/ | grep installation
# Should return nothing

Useful Joomla Admin Tasks {#admin}

Core updates

  1. System → Update → Joomla — shows available updates
  2. Click Update Now

Always back up before updating:

# Database backup
mysqldump -u joomla_user -p joomla_db | gzip > joomla_db_$(date +%Y%m%d).sql.gz

# Files backup
tar czf joomla_files_$(date +%Y%m%d).tar.gz /var/www/joomla/

Install extensions

  1. System → Install → Extensions
  2. Search or upload a .zip extension file
  3. Click Install

Popular extensions: Akeeba Backup (backups), JCE Editor (rich text), SP Page Builder (drag-and-drop).

Template management

  1. System → Templates → Site Templates
  2. Install a new template via the extension installer
  3. Set as default

Troubleshooting {#troubleshooting}

Issue Likely Cause Fix
Connection refused Service not running or wrong port Check systemctl status SERVICE and verify firewall rules
Permission denied Wrong file ownership or permissions Check file ownership with ls -la and use chown/chmod to fix
502 Bad Gateway Backend service not running Restart the backend service; check logs with journalctl -u SERVICE
SSL certificate error Certificate expired or domain mismatch Run sudo certbot renew and verify domain DNS points to server IP
Service not starting Config error or missing dependency Check logs with journalctl -u SERVICE -n 50 for specific error
Out of disk space Logs or data accumulation Run df -h to identify usage; clean logs or attach CBS storage
High memory usage Too many processes or memory leak Check with htop; consider upgrading instance plan if consistently high
Firewall blocking traffic Port not open in UFW or Lighthouse console Open port in Lighthouse console firewall AND sudo ufw allow PORT

Frequently Asked Questions {#faq}

Can I migrate an existing Joomla site to a cloud server?
Yes. Export your content and database from the current host, import them on the new server, then update your DNS to point to the new IP. Update any hardcoded URLs in the database or configuration files.

How do I keep Joomla updated securely?
Enable automatic minor updates where available, and manually update major versions after testing on a staging environment. Take a Lighthouse snapshot before any significant update.

Do I need a CDN for my Joomla site?
For international audiences, yes. A CDN like EdgeOne caches static assets at edge nodes worldwide, improving load times for visitors far from your server region.

What causes Joomla to be slow on a VPS?
Usually: missing caching plugin/configuration, unoptimized images, too many plugins, or insufficient server RAM. Start with a caching layer (Redis or built-in cache) and image optimization.

How do I secure the admin panel?
Change the default admin URL if possible, use a strong unique password, enable two-factor authentication, and consider restricting admin access by IP in your Nginx configuration.

Deploy your Joomla site today:
👉 Tencent Cloud Lighthouse — PHP-ready Ubuntu VPS
👉 View current pricing and promotions
👉 Explore all active deals and offers