How to Install Joomla on Debian 10
Joomla is a popular and widely used CMS (Content Management System) used for creating websites with little or no knowledge in markup or web programming languages. It ships with lots of PHP code, plugins, and themes that can help you get started from the ground up in no time.
In this guide, we are going to demonstrate how you can install Joomla CMS on Debian 10.
Let’s walk you through the Joomla CMS installation process.
Step 1: Update Debian System Packages
We begin by updating Debian system packages to their latest versions by running the following apt command.
$ sudo apt update -y && sudo apt upgrade -y
Step 2: Install LAMP Stack on Debian
LAMP stack is a popular free and open-source web hosting stack used for hosting websites. It’s an acronym for Linux, Apache, MySQL / MariaDB, and PHP. We are going to install each on these components. If you have already had a LAMP installed, you can skip this step.
We will begin by installing the Apache web server, PHP and finally MariaDB server.
Install Apache on Debian
To install Apache execute the commands below:
$ sudo apt install apache2 apache2-utils
Now start and enable the Apache webserver.
$ sudo systemctl start apache2 $ sudo systemctl enable apache2
To be sure that Apache web server is running, confirm using the command:
$ sudo systemctl status apache2
From the output, we can clearly see that the Apache webserver is up and running as expected.
Similarly, you can head over to your browser and browse your server’s IP as shown.
This is what you should get as a confirmation that your web server is up and running.
Install PHP in Debian
PHP is a server-side web programming language used by developers for designing dynamic web pages. We are going to install PHP 7.2.
$ sudo apt install libapache2-mod-php7.2 openssl php-imagick php7.2-common php7.2-curl php7.2-gd php7.2-imap php7.2-intl php7.2-json php7.2-ldap php7.2-mbstring php7.2-mysql php7.2-pgsql php-smbclient php-ssh2 php7.2-sqlite3 php7.2-xml php7.2-zip
When the installation is complete, confirm the version on PHP using the command:
$ php -v
Install MariaDB in Debian
The last component of the LAMP stack is the database server, which in this case will be MariaDB. MariaDB is a free and open-source database engine which was forked from MySQL.
To install MariaDB execute the command:
$ sudo apt install mariadb-server
Upon installation, extra steps are needed to secure the database server. This is primarily because the default settings are weak and leave the server prone to security breaches. So, to fortify the server, run the command:
$ sudo mysql_secure_installation
Press ENTER when prompted for the root password and press
‘Y’ to set the root password.
For subsequent prompts, simply type
‘Y’ and press the ENTER key for recommended settings.
We have finally secured our database engine.
Step 3: Create a Joomla Database
In this section, we are going to create a database for Joomla to store its files during and after the installation.
So, log in to MariaDB as shown:
$ sudo mysql -u root -p
We are now going to create the Joomla database, Joomla database user and grant privileges to the database user using the command below.
MariaDB [(none)]> CREATE DATABASE joomla_db; MariaDB [(none)]> GRANT ALL ON joomla_db.* TO ‘joomla_user’@’localhost’ IDENTIFIED BY ‘[email protected]’; MariaDB [(none)]> FLUSH PRIVILEGES; MariaDB [(none)]> EXIT;
Step 4: Download Joomla in Debian
Let’s now download Joomla’s installation package from the Official Joomla’s website. At the time of penning down this guide, the latest version is Joomla 3.9.16.
To download the latest Joomla package, execute the wget command.
$ sudo wget https://downloads.joomla.org/cms/joomla3/3-9-16/Joomla_3-9-16-Stable-Full_Package.zip
This will take a minute or two depending on your internet speed. Upon completion of the download, create a new directory ‘joomla’ in the webroot directory as shown.
$ sudo mkdir -p /var/www/html/joomla
Thereafter, unzip the zipped Joomla file to the just created ‘Joomla’ directory.
$ sudo unzip Joomla_3.19-16-Stable-Full_package.zip -d /var/www/html
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
For systemd to effect the changes, restart the Apache webserver.
$ sudo systemctl restart apache2
Step 5: Configuring Apache for Joomla
Finally, we need to configure the Apache webserver to server Joomla web pages. To accomplish this, we will create a virtual host file for Joomla as shown.
$ sudo vim /etc/apache2/sites-available/joomla.conf
Paste the configuration below into the file and save.
<VirtualHost *:80> ServerName joomla.example.com ServerAdmin [email protected] DocumentRoot /var/www/html/joomla <Directory /var/www/html/joomla> Allowoverride all </Directory> </VirtualHost>
Then disable the default configuration file and enable the Joomla virtual host file as shown.
$ sudo a2dissite 000-default.conf $ sudo a2ensite joomla.conf
Then restart the Apache webserver service for the changes to come into effect.
$ sudo systemctl restart apache2
Step 6: Finalizing Joomla Installation in Debian
To finalize the installation of Joomla. Launch your browser and browse your server’s URL as shown.
The page below will be displayed. To continue, ensure that you fill in the required details such as Site name, Email address, username and password.
Once done, click the ‘Next’ button. The next section will require you to fill in the database details that you earlier specified earlier when creating a database for Joomla. These include database name, database user and password.
Then click ‘Next’. The proceeding page will give you an overview of all the settings and allow you to perform a pre-installation check.
Scroll down to the ‘Pre-installation Check’ and ‘Recommended settings’ sections and ensure all the settings and installed package versions are as per the recommended guidelines.
Then click the ‘Install’ button to begin Joomla setup. Upon completion, you will get the notification below indicating that Joomla has been installed.
To proceed to the next step, however, you will be required to purge or delete the installation folder. So scroll down and click on the ‘Remove installation folder’ button shown below.
To login to the back end or dashboard click on the ‘Administrator’ button which takes you to the login page shown.
Provide your username and password and click on the ‘Login’ button to access Joomla’s control panel as shown.
And that’s it! We have successfully installed Joomla on Debian 10.