How to Install Joomla on Debian 12

Joomla is a free and open-source content management system for publishing web content on websites. Web content applications include discussion forums, photo galleries, e-Commerce, and user communities, and numerous other web-based applications.

Update the System to latest,

apt update

apt upgrade

LAMP Stack Configuration

Joomla like any other CMS application, will require a web server with Database running on the system to support it.

And since Joomla is built on PHP, we will need to install PHP as well.

Install Apache and PHP

We will now install Apache and PHP and other supporting packages by running the below command,

apt install apache2 libapache2-mod-php openssl php-imagick php-gd php-imap php-intl php-json php-ldap php-mbstring php-mysql php-pgsql php-smbclient php-ssh2 php-sqlite3 php-xml php-zip

Verify apache version using below command,

apache2 -version

Output:

root@server:~# apache2 -version
Server version: Apache/2.4.57 (Debian)
Server built:   2023-04-13T03:26:51

Now start and enable the Apache Web server,

systemctl start apache2 
systemctl enable apache2

Verify Apache is up and running using below command,

systemctl status apache2

Output:

root@server:~# systemctl status apache2
● apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; preset: enab>
     Active: active (running) since Sat 2023-06-17 14:18:37 EDT; 19s ago
       Docs: https://httpd.apache.org/docs/2.4/
   Main PID: 1227 (apache2)
      Tasks: 55 (limit: 2306)
     Memory: 21.6M
        CPU: 133ms
     CGroup: /system.slice/apache2.service
             ├─1227 /usr/sbin/apache2 -k start
             ├─1229 /usr/sbin/apache2 -k start
             └─1230 /usr/sbin/apache2 -k start

Jun 17 14:18:37 server systemd[1]: Starting apache2.service - The Apache HTTP S>
Jun 17 14:18:37 server systemd[1]: Started apache2.service - The Apache HTTP Se>

Open server IP address on your browser(http://Server_Ip) to see default Apache page.

Note: Replace Server_Ip with actual IP address of the server.

Verify PHP using below command

php -v  

Output:

  root@server:~# php -v
PHP 8.2.7 (cli) (built: Jun  9 2023 19:37:27) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.7, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.7, Copyright (c), by Zend Technologies

Install MariaDB

Let us install MariaDB on the server now with the following command,

apt install mariadb-server

MariaDB is not secured by default, As a precaution, we are secure the database engine using below command.

mysql_secure_installation

Create a Joomla Database

Login to MariaDB using the command

mysql -u root -p

Let us configure the Database so Joomla can connect to it and store the data.

For this, we will create a Database, create a User and grant certain Privileges to the User. Refer the below commands for the usecase.

CREATE DATABASE joomladb;

CREATE USER 'joomlauser'@'localhost' IDENTIFIED BY 'StrongPassword';

FLUSH PRIVILEGES;

EXIT;

Replace the StrongPassword with a strong and secure password.

Download and Extract Joomla

We will now download the latest version of Joomla from the Official site.

Download Joomla in Debian using below command,

wget https://github.com/joomla/joomla-cms/releases/download/4.3.2/Joomla_4.3.2-Stable-Full_Package.zip

Once the download is complete. We need to unzip this to the /var/www/html/ directory. Make the directory called Joomla.

apt install unzip 

mkdir /var/www/html/joomla

Unzip the zipped Joomla file to ‘Joomla’ directory created above.

unzip Joomla_4.3.2-Stable-Full_Package.zip -d /var/www/html/joomla

After unzip, Set the directory ownership of the directory to Apache user and change the permissions using below command,

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

Restart Apache Web server using following command,

systemctl restart apache2 

Configuring Apache for Joomla

Configure the Apache webserver to serve Joomla webpages. For this create a virtual host's file for Joomla and name it joomla.conf,

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

Add the following content into the file

<VirtualHost *:80>
 ServerAdmin admin@dev.domainhere.info
 DocumentRoot /var/www/html/joomla/
 ServerName dev.domainhere.info

 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>

Save and exit the file,

Replace dev.domainhere.info with your actual domain name.

Enable the virtual host file,

a2ensite joomla.conf
a2enmod rewrite

After this Restart Apache Webserver using below command,

systemctl restart apache2

Open your browser to load the site, http://dev.domainhere.info.

Install SSL Certificate

Let us install the SSL Certificate from Let's Encrypt. For this, you will need to install certbot via snapd.

Installing snapd,

apt install snapd

Check the snapd for updates,

snap install core; snap refresh core

Install Certbot

snap install --classic certbot

ln -s /snap/bin/certbot /usr/bin/certbot

Since we're using Apache web server, run the below command to get the certificate,

certbot --apache

The Certbot will take care of your renewal automatically before they expire, you would have to run the certbot again only if you make changes to your configuration. You can perform a test run with below command,

certbot renew --dry-run

Next, reload the page on the browser and it should then redirect and load the HTTPS site https://dev.domainhere.info.

Joomla Configuration

On the browser, we will configure the remaining aspects of getting our Joomla CMS up and running

Upon loading the domain, you will be prompted with setting up Language and Site Name

images

Enter the required details such as Username, User Account, Super User Password, and Email Address, and click on Setup Database Connection button

images

Enter the Database information that was configured earlier,

images

Enter the username and password which was set earlier,

images

View of the Dashboard after loggin in,

images

Done! This concludes the topic of installing latest version of Joomla on Debian 12.