Install Joomla on Debian 11

This guide will take you through how to install Joomla on Debian 11. Joomla is a content management system (CMS) used to create websites such as discussion forums, photo galleries, e-Commerce and user communities. It is made by a group of volunteers with the aid of the administrative, financial, and legal resources of Open Source Matters, Inc.

How to Install Joomla on Debian 11

Your system needs a server, PHP, and database for Joomla to work, in this example I will use the LAMP stack.

Install Apache Web Server on Debian 11

  • Install Apache using the command below.
sudo apt install -y apache2 apache2-utils
  • Enable Apache to start on boot.
sudo systemctl enable apache2
  • Start Apache server.
sudo systemctl start apache2

Install MariaDB Database Server on Debian 11

  • Run the following command to install MariaDB.
sudo apt install mariadb-server mariadb-client
  • Enable MariaDB to start on boot using the command below.
sudo systemctl enable mariadb
  • Start MariaDB.
sudo systemctl start mariadb
  • Run the following command to secure MariaDB.
sudo mysql_secure_installation

Sample output

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
haven't set the root password yet, you should just press enter here.

Enter current password for root (enter for none): 
OK, successfully used password, moving on...

Setting the root password or using the unix_socket ensures that nobody
can log into the MariaDB root user without the proper authorisation.

You already have your root account protected, so you can safely answer 'n'.

Switch to unix_socket authentication [Y/n] n
 ... skipping.

You already have your root account protected, so you can safely answer 'n'.

Change the root password? [Y/n] n
 ... skipping.

By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

Install PHP on Debian 11

  • Install PHP with commonly used extensions.
sudo apt install php libapache2-mod-php php-fpm php-mysql php-common php-cli php-common php-opcache php-readline php-mbstring php-xml php-gd php-curl
  • Activate the PHP module using the command below.
sudo a2enmod php7.4
  • Restart Apache to apply changes to your system.
sudo systemctl restart apache2

Create Joomla Database on Debian 11

  • Login to your MariaDB.
sudo mysql -u root -p
  • Then create the Joomla database.
CREATE DATABASE Joomla_db;
  • Next, create the database user and password.
CREATE USER 'joomla_user'@'localhost' IDENTIFIED BY 'Joomla_password';
  • Give all privileges to the user created.
GRANT ALL PRIVILEGES ON Joomla_db.* TO 'joomla_user'@'localhost';
  • Flush privileges.
FLUSH PRIVILEGES;
  • Exit MariaDB.
exit;

Sample output

Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 36
Server version: 10.5.15-MariaDB-0+deb11u1 Debian 11

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> CREATE DATABASE Joomla_db;
Query OK, 1 row affected (0.001 sec)

MariaDB [(none)]> CREATE USER 'joomla_user'@'localhost' IDENTIFIED BY 'Joomla_password';
Query OK, 0 rows affected (0.002 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON Joomla_db.* TO 'joomla_user'@'localhost';
Query OK, 0 rows affected (0.002 sec)

MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.001 sec)

MariaDB [(none)]> exit;
Bye

Install Joomla on Debian 11

wget https://downloads.joomla.org/cms/joomla4/4-1-5/Joomla_4-1-5-Stable-Full_Package.zip?format=zip
  • Create a Joomla directory inside /var/www/html/.
sudo mkdir /var/www/html/joomla
  • Next, unzip Joomla to the directory created above.
sudo unzip Joomla_4-1-5-Stable-Full_Package.zip?format=zip -d /var/www/html/joomla
  • Give permission to Apache using the following commands.
sudo chown -R www-data:www-data /var/www/html/joomla
sudo chmod -R 755 /var/www/html/joomla

Debian 11 Joomla Apache virtual host configuration

  • Create Apache virtual host configuration file.
sudo nano /etc/apache2/sites-available/joomla.conf

Paste the configuration settings below. Note, change www.your-domain.com with your actual domain.

<VirtualHost *:80>  
ServerAdmin [email protected]
DocumentRoot /var/www/html/joomla/
ServerName your-domain.com
ServerAlias www.your-domain.com

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

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

Save(ctrl+s) and exit(ctrl+x) the file.

  • Delete default Apache site.
sudo a2dissite 000-default.conf
  • Enable site created.
sudo a2ensite joomla.conf
  • If you are using a firewall allow port 80.
sudo ufw allow 80/tcp
  • Restart the Apache server to apply changes.
sudo systemctl restart apache2

Access Joomla Web Interface on Debian 11

  • Open your browser and enter your server IP or domain name. Select your language and site name, check the example below.
Install Joomla on Debian 11
Install Joomla on Debian 11
  • Enter your login details.
Install Joomla on Debian 11
Install Joomla on Debian 11
  • Enter your database details.
Install Joomla on Debian 11
Install Joomla on Debian 11
  • If the information you gave was accurate, you ought to be able to see the page below.
Install Joomla on Debian 11
Install Joomla on Debian 11
  • When you open administrator, you will be required to enter the username and password you created during the installation.
Install Joomla on Debian 11
Install Joomla on Debian 11
  • Sample administrator dashboard.
Install Joomla on Debian 11
Install Joomla on Debian 11
  • Sample Joomla site.
Install Joomla on Debian 11
Install Joomla on Debian 11
  • You have made it to the end of our article, Congratulations. We have gone through how to install Joomla on Debian 11.

Read more on Joomla Documentation

Other Tutorials

Install WordPress with LAMP Stack on Ubuntu 22.04

Install LAMP Stack on OpenSUSE

Install WordPress with LEMP Stack on Ubuntu 22.04

System administrator | Software Developer | DevOps

Leave a Comment