Deployment Guide

    Deploy Joomla!

    Joomla! is a powerful, open-source CMS for building websites and applications. This guide covers deploying Joomla! on RamNode's reliable VPS hosting with Apache, MariaDB, PHP, SSL encryption, and security hardening.

    Ubuntu 24.04 LTS
    LAMP Stack
    ⏱️ 30-45 minutes
    1

    Introduction

    Joomla! is a powerful, open-source content management system (CMS) that enables you to build websites and powerful online applications. With its intuitive interface, extensive extension library, and strong community support, Joomla! is excellent for everything from simple blogs to complex enterprise websites.

    Why Choose Joomla!?

    • User-friendly administration interface
    • Extensive library of extensions and templates
    • Multi-language support built-in
    • Strong access control and user management
    • Active community with regular updates
    • SEO-friendly out of the box
    2

    Prerequisites

    Before beginning the installation, ensure you have the following:

    RequirementMinimumRecommended
    RAM1 GB2 GB+
    Storage20 GB SSD40 GB+ NVMe
    CPU1 vCPU2+ vCPU
    OSUbuntu 24.04 LTS (fresh installation preferred)

    You'll also need root or sudo access, a registered domain name pointed to your VPS IP, and basic familiarity with the Linux command line.

    3

    Initial Server Setup

    Connect to your RamNode VPS via SSH and update the system packages:

    Connect and update
    ssh root@your-server-ip
    
    # Update package lists and upgrade installed packages
    apt update && apt upgrade -y
    
    # Set the timezone (adjust to your location)
    timedatectl set-timezone America/New_York
    
    # Install essential utilities
    apt install -y curl wget unzip software-properties-common

    Create a Sudo User

    For security, create a non-root user with sudo privileges:

    Create user
    # Create new user
    adduser joomlaadmin
    
    # Add user to sudo group
    usermod -aG sudo joomlaadmin
    
    # Switch to the new user
    su - joomlaadmin
    4

    Install Apache Web Server

    Apache is the most widely used web server and works excellently with Joomla!:

    Install Apache
    sudo apt install -y apache2
    
    # Enable required Apache modules
    sudo a2enmod rewrite headers expires deflate
    
    # Start and enable Apache
    sudo systemctl start apache2
    sudo systemctl enable apache2
    
    # Verify Apache is running
    sudo systemctl status apache2

    You can verify the installation by visiting your server's IP address in a browser. You should see the Apache2 Ubuntu default page.

    5

    Install MariaDB Database Server

    MariaDB is a community-developed fork of MySQL with improved performance:

    Install MariaDB
    # Install MariaDB
    sudo apt install -y mariadb-server mariadb-client
    
    # Secure the installation
    sudo mysql_secure_installation

    During the secure installation process:

    • Switch to unix_socket authentication: N
    • Set root password: Y (choose a strong password)
    • Remove anonymous users: Y
    • Disallow root login remotely: Y
    • Remove test database: Y
    • Reload privilege tables: Y

    Create Joomla! Database

    Create database
    sudo mysql -u root -p
    SQL commands
    -- Create the database
    CREATE DATABASE joomla_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    
    -- Create a dedicated user (replace password with your own)
    CREATE USER 'joomla_user'@'localhost' IDENTIFIED BY 'StrongPassword123!';
    
    -- Grant privileges
    GRANT ALL PRIVILEGES ON joomla_db.* TO 'joomla_user'@'localhost';
    
    -- Apply changes
    FLUSH PRIVILEGES;
    EXIT;
    6

    Install PHP and Required Extensions

    Joomla! 5.x requires PHP 8.1 or higher. Ubuntu 24.04 includes PHP 8.3:

    Install PHP
    sudo apt install -y php libapache2-mod-php php-mysql php-xml \
      php-gd php-curl php-zip php-mbstring php-intl php-json \
      php-bcmath php-soap php-ldap php-memcached php-redis

    Configure PHP Settings

    Edit the PHP configuration file:

    Edit php.ini
    sudo nano /etc/php/8.3/apache2/php.ini

    Update the following values:

    php.ini settings
    memory_limit = 256M
    upload_max_filesize = 64M
    post_max_size = 64M
    max_execution_time = 300
    max_input_time = 300
    max_input_vars = 5000
    date.timezone = America/New_York
    Restart Apache
    sudo systemctl restart apache2
    7

    Download and Install Joomla!

    Download the latest stable version of Joomla! from the official website:

    Download Joomla!
    # Navigate to web root
    cd /var/www/html
    
    # Download latest Joomla! (check https://downloads.joomla.org for current version)
    sudo wget https://downloads.joomla.org/cms/joomla5/5-2-4/Joomla_5-2-4-Stable-Full_Package.zip
    
    # Create Joomla directory
    sudo mkdir joomla
    
    # Extract the package
    sudo unzip Joomla_5-2-4-Stable-Full_Package.zip -d joomla
    
    # Set proper ownership
    sudo chown -R www-data:www-data /var/www/html/joomla
    
    # Set directory permissions
    sudo find /var/www/html/joomla -type d -exec chmod 755 {} \;
    sudo find /var/www/html/joomla -type f -exec chmod 644 {} \;
    
    # Clean up
    sudo rm Joomla_5-2-4-Stable-Full_Package.zip
    8

    Configure Apache Virtual Host

    Create a dedicated virtual host configuration for your Joomla! site:

    Create config
    sudo nano /etc/apache2/sites-available/joomla.conf

    Add the following configuration (replace yourdomain.com with your actual domain):

    joomla.conf
    <VirtualHost *:80>
        ServerName yourdomain.com
        ServerAlias www.yourdomain.com
        ServerAdmin admin@yourdomain.com
        DocumentRoot /var/www/html/joomla
    
        <Directory /var/www/html/joomla>
            Options FollowSymLinks
            AllowOverride All
            Require all granted
        </Directory>
    
        ErrorLog ${APACHE_LOG_DIR}/joomla_error.log
        CustomLog ${APACHE_LOG_DIR}/joomla_access.log combined
    </VirtualHost>
    Enable site
    # Enable the Joomla site
    sudo a2ensite joomla.conf
    
    # Disable default site (optional)
    sudo a2dissite 000-default.conf
    
    # Test Apache configuration
    sudo apache2ctl configtest
    
    # Reload Apache
    sudo systemctl reload apache2
    9

    Configure UFW Firewall

    Secure your server by configuring the UFW firewall:

    Configure firewall
    # Enable UFW
    sudo ufw enable
    
    # Allow SSH (important - don't lock yourself out!)
    sudo ufw allow ssh
    
    # Allow HTTP and HTTPS
    sudo ufw allow 'Apache Full'
    
    # Check firewall status
    sudo ufw status verbose
    10

    Install SSL Certificate with Let's Encrypt

    Secure your Joomla! site with a free SSL certificate from Let's Encrypt:

    Install Certbot
    # Install Certbot
    sudo apt install -y certbot python3-certbot-apache
    
    # Obtain and install certificate
    sudo certbot --apache -d yourdomain.com -d www.yourdomain.com
    
    # Test automatic renewal
    sudo certbot renew --dry-run

    Certbot will automatically configure Apache to redirect HTTP to HTTPS and set up automatic certificate renewal.

    11

    Complete Joomla! Web Installation

    Open your browser and navigate to https://yourdomain.com to begin the Joomla! web installer.

    Configuration Steps:

    1. Select Language: Choose your preferred language for the installation and admin interface.
    2. Site Configuration: Enter your site name, description, admin email, username, and password.
    3. Database Configuration: Enter the database details created earlier (joomla_db, joomla_user, and your password).
    4. Finalize Installation: Review settings and complete the installation.
    12

    Post-Installation Security Hardening

    Remove Installation Directory

    The Joomla! installer prompts you to delete the installation folder. If it doesn't auto-delete:

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

    Secure configuration.php

    Protect config
    sudo chmod 444 /var/www/html/joomla/configuration.php

    Configure .htaccess

    Rename htaccess
    # Rename the file
    sudo mv /var/www/html/joomla/htaccess.txt /var/www/html/joomla/.htaccess
    
    # Edit to add security rules
    sudo nano /var/www/html/joomla/.htaccess

    Add these security rules at the end of the file:

    .htaccess security rules
    # Block access to sensitive files
    <FilesMatch "^(configuration\.php|htaccess\.txt|\.htaccess)quot;>
        Require all denied
    </FilesMatch>
    
    # Disable directory browsing
    Options -Indexes
    
    # Block common exploits
    RewriteCond %{QUERY_STRING} (<|%3C).*script.*(>|%3E) [NC,OR]
    RewriteCond %{QUERY_STRING} GLOBALS(=|\[|%[0-9A-Z]{0,2}) [OR]
    RewriteCond %{QUERY_STRING} _REQUEST(=|\[|%[0-9A-Z]{0,2})
    RewriteRule ^.*$ - [F,L]

    Enable Two-Factor Authentication

    Enable 2FA for all administrator accounts through the Joomla! admin panel (System → Users → Manage → Edit User → Multi-factor Authentication).

    13

    Performance Optimization

    Enable Joomla! Caching

    In the Joomla! administrator panel, navigate to System → Global Configuration → System and configure:

    • Cache: ON - Conservative caching
    • Cache Handler: File
    • Cache Time: 15 (minutes)

    Configure OPcache

    Edit OPcache config
    sudo nano /etc/php/8.3/apache2/conf.d/10-opcache.ini

    Add these optimized settings:

    OPcache settings
    opcache.enable=1
    opcache.memory_consumption=256
    opcache.interned_strings_buffer=16
    opcache.max_accelerated_files=10000
    opcache.revalidate_freq=60
    opcache.fast_shutdown=1
    opcache.enable_cli=0
    Restart Apache
    sudo systemctl restart apache2

    Enable Gzip Compression

    Enable Gzip in Joomla! (System → Global Configuration → Server → Gzip Page Compression: Yes) and verify Apache's deflate module:

    deflate.conf
    <IfModule mod_deflate.c>
        AddOutputFilterByType DEFLATE text/html text/plain text/xml
        AddOutputFilterByType DEFLATE text/css text/javascript
        AddOutputFilterByType DEFLATE application/javascript application/x-javascript
        AddOutputFilterByType DEFLATE application/json application/xml
        AddOutputFilterByType DEFLATE application/rss+xml application/atom+xml
    </IfModule>
    14

    Configure Automated Backups

    Set up automated backups to protect your Joomla! installation:

    Create backup script
    # Create backup directory
    sudo mkdir -p /var/backups/joomla
    
    # Create backup script
    sudo nano /usr/local/bin/joomla-backup.sh

    Add the following backup script:

    joomla-backup.sh
    #!/bin/bash
    DATE=$(date +%Y%m%d_%H%M%S)
    BACKUP_DIR="/var/backups/joomla"
    
    # Backup database
    mysqldump -u joomla_user -p'StrongPassword123!' joomla_db | gzip > "$BACKUP_DIR/db_$DATE.sql.gz"
    
    # Backup files
    tar -czf "$BACKUP_DIR/files_$DATE.tar.gz" -C /var/www/html joomla
    
    # Delete backups older than 7 days
    find $BACKUP_DIR -type f -mtime +7 -delete
    
    echo "Backup completed: $DATE"
    Enable backup cron
    # Make script executable
    sudo chmod +x /usr/local/bin/joomla-backup.sh
    
    # Add to crontab for daily backups at 2 AM
    echo "0 2 * * * root /usr/local/bin/joomla-backup.sh" | sudo tee -a /etc/crontab
    15

    Troubleshooting Common Issues

    Ongoing Maintenance

    • Update Joomla! Core: Check for updates weekly (System → Update → Joomla)
    • Update Extensions: Keep all plugins, modules, and components updated
    • Monitor Logs: Review error logs regularly for security issues
    • Verify Backups: Periodically test backup restoration
    • Server Updates: Run apt update && apt upgrade weekly

    Ready to Deploy Joomla!?

    Get started with a RamNode VPS optimized for CMS hosting with SSD storage and excellent performance.