How To

Install Joomla on Ubuntu 18.04 with Apache: LAMP Stack Guide

Joomla is one of the most popular open-source content management systems in the world. It is written in PHP and comes with a large ecosystem of extensions and templates that can turn it into an e-commerce store, a community portal, a business site, or a blog. It is a strong alternative to WordPress, particularly for projects that need finer-grained user roles and access control built into the core.

This guide walks you through installing Joomla on Ubuntu 18.04 with Apache using a LAMP stack (Linux, Apache, MySQL/MariaDB, PHP 7.2), all running behind HTTPS.

Prerequisites:

  • A domain name pointing to your server’s public IP
  • Apache installed and running
  • A Let’s Encrypt SSL certificate installed for your domain

Install Joomla on Ubuntu: Create the MySQL Database

Joomla stores articles, categories, users, extensions, and configuration data in a MySQL or MariaDB database. If MySQL is not already installed on your server, install it first:

bashsudo apt-get updatesudo apt-get install mysql-server

Log into the MySQL shell:

bashsudo mysql

Create a dedicated Joomla database with the correct character set:

sqlCREATE DATABASE joomla CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;

Create a database user and grant it full access. Replace the placeholder with a strong password:

sqlGRANT ALL ON joomla.* TO 'joomlauser'@'localhost' IDENTIFIED BY 'change-with-strong-password';

Exit the MySQL shell:

sqlEXIT

Install PHP 7.2 and Download Joomla Files

PHP 7.2 is the default version on Ubuntu 18.04 and is fully supported by Joomla. Install it along with all required extensions:

bashsudo apt install php7.2 php7.2-cli php7.2-mysql php7.2-json php7.2-opcache php7.2-mbstring php7.2-intl php7.2-xml php7.2-gd php7.2-zip php7.2-curl php7.2-xmlrpc

Joomla requires specific PHP settings that differ from the Ubuntu defaults. Apply them with these sed commands:

bashsudo sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/7.2/apache2/php.inisudo sed -i "s/upload_max_filesize = .*/upload_max_filesize = 256M/" /etc/php/7.2/apache2/php.inisudo sed -i "s/post_max_size = .*/post_max_size = 256M/" /etc/php/7.2/apache2/php.inisudo sed -i "s/max_execution_time = .*/max_execution_time = 300/" /etc/php/7.2/apache2/php.inisudo sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/7.2/apache2/php.ini

Restart Apache to load the new PHP configuration:

bashsudo systemctl restart apache2

Create the document root and download the Joomla release archive:

bashsudo mkdir -p /var/www/example.comcd /var/www/example.comsudo wget https://downloads.joomla.org/cms/joomla3/3-9-4/Joomla_3-9-4-Stable-Full_Package.zipsudo unzip Joomla_3-9-4-Stable-Full_Package.zip

Set the correct ownership so Apache can read and write the Joomla files:

bashsudo chown -R www-data: /var/www/example.com

Configure Apache and Complete the Web Installer

Create an Apache virtual host configuration file for your domain:

bashsudo nano /etc/apache2/sites-available/example.com.conf

Paste the following configuration, replacing example.com with your domain and updating the SSL certificate paths:

apache<VirtualHost *:80>  ServerName example.com  Redirect permanent / https://example.com/</VirtualHost><VirtualHost *:443>  ServerName example.com  DocumentRoot /var/www/example.com  SSLEngine On  SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem  SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem  <Directory /var/www/example.com>    AllowOverride All    Require all granted  </Directory></VirtualHost>

Enable the virtual host and restart Apache:

bashsudo a2ensite example.comsudo systemctl restart apache2

Open your domain in a browser. The Joomla setup wizard walks you through three screens:

Step 1 – Main Configuration: Enter your site name, a fallback meta description, and the admin account details. Set the admin username to something other than admin for security, and choose a strong password.

Step 2 – Database Configuration: Leave the type as MySQLi and the hostname as localhost. Fill in the database name (joomla), username (joomlauser), and the password you created earlier. Leave the table prefix as the auto-generated value.

Step 3 – Overview: Review your settings and confirm the pre-installation checks pass. Click Install to complete the setup.

After installation, Joomla prompts you to remove the installation directory. Do this immediately — leaving it in place is a security risk:

bashsudo rm -rf /var/www/example.com/installation

Access the Joomla administration panel at https://example.com/administrator.

Joomla is now installed and running on your Ubuntu 18.04 server. Visit the Joomla Documentation to learn about extensions, templates, and user management. Leave a comment below if you run into any issues.

Cyber Defence

Recent Posts

Install PHP on Ubuntu 26.04: Apache, Nginx, and Multiple Versions

PHP 8.5 is included in Ubuntu 26.04's default repositories and is the recommended version for…

2 days ago

Upgrade to Ubuntu 26.04 from 25.10 and 24.04 LTS: Complete Guide

Ubuntu 26.04 LTS "Resolute Raccoon" arrived on April 23, 2026 with Linux kernel 7.0, GNOME 50,…

2 days ago

Install Kubernetes on Ubuntu 26.04 with kubeadm and containerd

Kubernetes is the standard platform for running containerized workloads across multiple servers with self-healing, rolling…

2 days ago

Install Ubuntu 26.04: Bootable USB, Partitioning, and First Steps

Ubuntu 26.04 LTS "Resolute Raccoon" was released on April 23, 2026 with Linux kernel 7.0, GNOME desktop, and standard security support until April 2031. A clean install gives you a known-good starting point on new hardware, when replacing another operating system, or when an upgrade path is not practical. This guide walks through how to install Ubuntu 26.04: downloading and verifying the ISO, writing a bootable USB drive, completing the installer, and doing the initial setup after the first boot. Before you start: You need a USB drive with at least 12 GB of free space. Back up any existing data on the target machine — the installer can erase the entire disk. Install Ubuntu 26.04: Download the ISO…

2 days ago

Change Timezone on Ubuntu: timedatectl and Desktop GUI Guide

The correct timezone affects more than the clock on your screen. It drives cron job scheduling, systemd timer execution, log file timestamps, database record timing, and SSL certificate validity checks. A mismatched timezone can cause scheduled jobs to fire at the wrong hour and make log timestamps impossible to match with real-world events. This guide shows how to change timezone on Ubuntu using the timedatectl command (the recommended approach for servers and remote machines) and through the graphical Date & Time settings on desktop systems. The steps apply to all current Ubuntu releases including 24.04 and 26.04. <strong>Prerequisite:</strong>&nbsp;Only&nbsp;the&nbsp;root&nbsp;user&nbsp;or&nbsp;a&nbsp;user&nbsp;with&nbsp;sudo&nbsp;access&nbsp;can&nbsp;change&nbsp;the&nbsp;system&nbsp;timezone. Check the Current Timezone Before You Change It Run timedatectl with no arguments to see the active timezone and clock status: bashtimedatectl Sample output: Local…

2 days ago

Install Atom on Ubuntu 18.04: GitHub’s Code Editor APT Setup

Atom is a free, open-source, cross-platform code editor developed by GitHub. Built on Electron, it uses…

2 days ago