How to Install Joomla with LAMP on Ubuntu 18.04 Bionic Beaver

Install Joomla with LAMP on Ubuntu 18.04

In this article, we will have explained the necessary steps to install and configure Joomla on Ubuntu 18.04 LTS. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.

Joomla is one of the most popular open-source content management systems that powers hundreds of thousands of websites. It is written in PHP and packs a ton of features that can be extended with free and premium extensions and themes. With Joomla, you can easily build your eCommerce store, personal website, or blog.

Install Joomla on Ubuntu

Step 1. First, before you start installing any package on your Ubuntu server, we always recommend making sure that all system packages are updated.

sudo apt update
sudo apt upgrade

Step 2. Install LAMP Stack.

Joomla is built with PHP. You can host it like you would any other web app is written in PHP. So, you’re going to need to set Ubuntu up as either a LAMP server. If you haven’t done so already, use our traditional LAMP guide to set up Ubuntu to serve PHP before you continue.

Step 3. Creating a MySQL database for Joomla.

Joomla uses the MySQL database to store all its data like posts, pages, users, plugins, and themes settings. Log in to your MySQL server with the following command and enter your MySQL root password:

mysql -u root -p

Once you’re in the MySQL console, create a new database:

GRANT ALL PRIVILEGES ON joomla.* TO 'admin_user'@'localhost' IDENTIFIED BY 'Your_Strong_Password';

Step 4. Install Joomla on Ubuntu 18.04.

Before downloading the Joomla archive, first create a directory that will hold the Joomla files and navigate to it:

sudo mkdir -p /var/www/
cd /var/www/

Next, download the current release of Joomla from the Joomla downloads page using the following wget command:

sudo wget
sudo unzip

Set the directory permissions accordingly:

sudo chown -R www-data: /var/www/

Step 5. Configuring Apache for Joomla.

Create a new virtual host configuration file for your Joomla website, named

nano /etc/apache2/sites-available/

And add the following content to the file:

<VirtualHost *:80>
     ServerAdmin [email protected]
     DocumentRoot /var/www/

     ErrorLog ${APACHE_LOG_DIR}/error.log
     CustomLog ${APACHE_LOG_DIR}/access.log combined

     <Directory /var/www/>
            Options FollowSymlinks
            AllowOverride All
            Require all granted

To enable the virtual host we have just created, run the following command:

ln -s /etc/apache2/sites-available/ /etc/apache2/sites-enabled/

For the new configuration to take effect, restart the Apache service by typing:

sudo systemctl restart apache2

Step 6. Completing the Joomla Installation.

In the last step of this guide, we need to access the Joomla Web Interface and finish the installation. To finish the installation, open your browser and navigate to:

That’s all you need to do to install Joomla CMS on Ubuntu 18.04. I hope you find this quick tip helpful. If you have questions or suggestions, feel free to leave a comment below.