How to Install Joomla with LAMP on Debian 10

Install Joomla with LAMP on Debian 10

In this article, we will have explained the necessary steps to install Joomla with LAMP on Debian 10. 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 content management system (CMS) which used by people around the world. Joomla 3 is the latest stable version recommended for all new projects. 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 with LAMP on Debian 10

Step 1. The first command will update the package lists to ensure you get the latest version and dependencies.

sudo apt update
sudo apt upgrade

Step 2. Install LAMP Stack on Debian Linux.

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 Debian up as either a LAMP server. If you haven’t done so already, use our traditional LAMP guide to set up Debian to serve PHP before you continue.

Step 3. Install Joomla on the Debian system.

Download the latest version of Joomla CMS from the official website:

wget https://downloads.joomla.org/cms/joomla3/3-9-26/Joomla_3-9-26-Stable-Full_Package.zip

Once the download is complete. We need to unzip this to the webroot directory:

sudo mkdir /var/www/html/joomla
sudo unzip Joomla_3-9-26-Stable-Full_Package.zip -d /var/www/html/joomla

Next, set the directory ownership of the directory to Apache user and change the permissions as indicated below:

sudo chown -R www-data:www-data /var/www/html/joomla
sudo chmod -R 755 /var/www/html/joomla

Step 4. 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:

MariaDB [(none)]> CREATE DATABASE joomla_db;MariaDB [(none)]> GRANT ALL ON joomla_db.* TO ‘joomla_user’@’localhost’ IDENTIFIED BY ‘strong-your-passwd’;MariaDB [(none)]> FLUSH PRIVILEGES;MariaDB [(none)]> EXIT;

Step 5. Configuring Apache for Joomla.

Create a new virtual host configuration file for your Joomla website, named joomla.conf:

nano /etc/apache2/sites-available/joomla.conf

And add the following content to the file:

<VirtualHost *:80>
     ServerAdmin admin@your-domain.com
     DocumentRoot /var/www/html/joomla/
     ServerName your-domain.com
     ServerAlias www.your-domain.com

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

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

Then restart the Apache webserver service for the changes to come into effect:

ln -s /etc/apache2/sites-available/joomla.conf /etc/apache2/sites-enabled/joomla.conf

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

sudo a2ensite joomla.conf
sudo a2enmod rewrite 
sudo systemctl restart apache2

Step 6. Secure Joomla with Let’s Encrypt SSL.

First, you will need to install the Certbot client to install and manage the Let’s Encrypt SSL. You can install it with the following command:

sudo apt install certbot python3-certbot-apache

Once the Certbot is installed, run the following command to download and install Let’s Encrypt SSL for your website:

certbot --apache -d your_domain.com

Step 7. Finalizing the Joomla Installation on Debian

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:

https://your-domain.com/joomla

That’s all you need to do to install Joomla on Debian 10 (Buster). I hope you find this quick tip helpful. For further reading on the Joomla content management system (CMS), please refer to their official knowledge base. If you have questions or suggestions, feel free to leave a comment below.