How to Install Joomla on Debian 12

Estimated reading: 6 minutes 299 views

Joomla CMS is an open-source content management system for building websites and online applications. It offers user-friendly features and extensibility and is freely available to everyone. Powered by PHP, it can be used for multiple scenarios, such as forums, photo galleries, e-commerce, and various web-based applications.

In this guide, we’ll cover the installation of Joomla CMS on the Debian 12.

Installing Dependencies

Joomla is an open-source CMS based on PHP and MySQL databases. To install it, ensure the required dependencies are installed.

Now, you will install the LAMP Stack and additional dependencies, such as UFW and Certbot, that Joomla will use.

Run the apt command below to update the Debian repository.

apt update

Now install Joomla dependencies using the apt command below. With this, you will install LAMP Stack packages, UFW, Certbot, and unzip utility.

apt install apache2 mariadb-server php php-curl php-common php-json php-intl php-xml php-gd php-mysql php-imagick php-mbstring php-zip ufw certbot python3-certbot-apache unzip

Verify the apache2 service to ensure that the service is running and enabled using the command below.

systemctl is-enabled apache2
systemctl status apache2

Lastly, verify the mariadb service using the command below. You should get the mariadb service enabled with the status active (running).

systemctl is-enabled mariadb
systemctl status mariadb

Configuring UFW

In this example, you will run Joomla with UFW (Uncomplicated Firewall) running and enabled. In that case, be sure to add SSH, HTTP, and HTTPS ports to UFW.

First, run the command below to enable the application profile ‘WWW Full’. The ‘WWW Full’ profile will open both HTTP and HTTPS ports – 80 and 443.

ufw allow 'WWW Full'

Then, enable UFW by executing the command below. Type y to confirm the process.

ufw enable

Verify uFW using the following command. Be sure the’WWW Full’ profiles are available on your UFW-enabled rules.

ufw status

Configuring PHP

After configuring UFW, the next step is to configure PHP for your Joomla installation.

Joomla required at least the following configurations on the php.ini file:

  • memory_limit: 256M
  • upload_max_filesize: 32M
  • post_max_size: 32M
  • max_execution_time: 30

Open the file ‘/etc/php/8.2/apache2/php.ini’ using the nano editor command below.

nano /etc/php/8.2/apache2/php.ini

Change the default php.ini configuration with the following. Be sure to adjust the memory_limit option with your current memory on your system.

output_buffering = Off
max_execution_time=60
memory_limit=2048M
post_max_size=64M
upload_max_filesize=64M

Save and close the file when you’re done.

Now run the command below to restart the apache2 service and apply your changes to PHP.

systemctl restart apache2

Configuring MariaDB

You will set up and secure the MariaDB server using the ‘mariadb-secure-installation’ tool. Then, you will also create a new database and user for Joomla via MySQL/MariaDB client.

Start securing your MariaDB server installation by executing the ‘mariadb-server-installation’ command below.

mariadb-secure-installation

Input Y to implement the new configuration, or type N for ‘No’ to reject.

Now that you’ve configured the MariaDB server, log in to MariaDB using the following command. Also, input your MariaDB root password when prompted.

mariadb -u root -p

Run the following queries to create a new database joomladb with user joomla. Also, make sure to change the database password ‘p4ssword’ with your strong password.

CREATE DATABASE joomladb;
CREATE USER joomla@localhost IDENTIFIED BY 'p4ssword';
GRANT ALL PRIVILEGES ON joomladb.* TO joomla@localhost;
FLUSH PRIVILEGES;

Next, run the following query to verify the privileges for the MariaDB user joomla@localhost.

SHOW GRANTS FOR joomla@localhost;

Type quit to exit from the MariaDB server and move on to the next step.

Downloading Joomla CMS

You will download the latest version of Joomla and set up proper permission and ownership of the Joomla source code.

Move to the /var/www directory and download Joomlad using the wget command below.

cd /var/www/
wget https://downloads.joomla.org/cms/joomla5/5-0-1/Joomla_5-0-1-Stable-Full_Package.zip

Once downloaded, extract the Joomla source code to the joomla directory using the following unzip command. With this, your Joomla installation directory will be located at /var/www/joomla.

unzip Joomla_5-0-1-Stable-Full_Package.zip -d joomla

Now change the ownership of /var/www/joomla directory to the user www-data and group www-data.

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

Setting Up Apache2 Virtual Host

You will create a new Apache virtual host configuration to run Joomla. Be sure that you have a domain name ready and pointed to your server IP address. For example here, we’ll use green123.com

To start, run the following nano editor command to create a new virtual host configuration ‘/etc/apache2/sites-available/joomla.conf’.

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

Insert the following configuration and be sure to change the domain name green123.com with your domain.

<VirtualHost *:80>

ServerAdmin [email protected]

ServerName green123.com
DocumentRoot /var/www/joomla

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

ErrorLog ${APACHE_LOG_DIR}/green123.com_error.log
CustomLog ${APACHE_LOG_DIR}/green123.com_access.log combined

</VirtualHost>

Save the file and exit the editor, when finished.

Next, run the command below to activate the virtual host file joomla.conf and verify your Apache syntax.

a2ensite joomla.conf
apachectl configtest

Now apply the new virtual host file joomla.conf by restarting Apache2 using the following systemctl command.

systemctl restart apache2

Installing Joomla via Web Installer

Open up your web browser and visit the domain name of your Joomla installation, such as (https://green123.com/). You will be presented with the Joomla web installer page.

Select the default language, and input the site name of your Joomla installation. Then, click Setup Login Data to configure the Joomla administrator user.

Input your name, username, email address, and the password for Joomla administrator user. Then, click Setup Database Connection to continue.

Input the MariaDB server database name, user, host, and the default database prefix. Then, click Install Joomla to start the installation process.

During the installation, you will see the following:

Below is the screenshot of the default homepage of the Joomla installation.

Within the Joomla administrator login page, input the admin user and password for your Joomla installation, then click Log in to confirm.

Conclusion

Congratulations! You’ve completed the installation of Joomla open-source CMS on the Debian 12. You’ve installed Joomla with the LAMP Stack (Apache, MariaDB, and PHP), and also secured your Debian server with UFW (Uncomplicated Firewall).

Hopefully, this article will be helpful for you. Good luck!