What is Joomla?

Joomla is a free and open-source content management system (CMS) designed to build websites and powerful online applications. It’s known for its extensibility and ease of use, both for web developers and site administrators. Joomla allows users to create, edit, publish, and manage web content, as well as control data and information on a website or intranet application. It’s suitable for a wide range of web content, including corporate sites, online magazines, e-commerce sites, and personal or family homepages.

 

 

How to install Joomla 5 on Ubuntu/Debian?

 

If you a fresh install you should update and upgrade the server.

sudo apt update && sudo apt upgrade -y

 

Next we need to install Apache, PHP with some extentions and MariaDB needed to run Joomla.

 

Apache:

sudo apt install apache2 -y

PHP and extentions:

sudo apt install php libapache2-mod-php php-curl php-gd php-intl php-mbstring php-mysql php-soap php-xml php-xmlrpc php-zip

MariaDB:

sudo apt install mariadb-server

 

After the all is installed it’s time to configure the several components

For MariaDB now you need to do a secure installation, that can set the root database user password, remove anonymous user, disallow root login remotely, remove test the database, and reload privilege tables.  

sudo mysql_secure_installation

Once you run this command basically you will reply to everything has Y (yes) and set a password when asked. 

Now after this is all done, it’s time to create a DB user and DB for joomla and for that you need to enter the command bellow and the password you defined on the previous command.

sudo mysql -u root -p


This prompt should appear.

MariaDB [(none)]>

Now you can create the user and database with the example bellow.

CREATE DATABASE joomla_db DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;

SHOW DATABASES;

GRANT ALL PRIVILEGES ON joomla_db.* TO joomla_user@localhost IDENTIFIED BY 'your_super_secret_password';

FLUSH PRIVILEGES;

EXIT;

Next, it’s Apache, you need to check systemd and configure a conf file for Joomla on Apache

Checking status of Apache web server:

sudo systemctl status apache2

If you have an output similar to this, all is good

apache2.service - The Apache HTTP Server

     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; preset: enabled)

     Active: active (running) since Fri 2024-04-19 17:15:06 WEST; 5 days ago

       Docs: https://httpd.apache.org/docs/2.4/

    Process: 664 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)

    Process: 50319 ExecReload=/usr/sbin/apachectl graceful (code=exited, status=0/SUCCESS)

   Main PID: 785 (apache2)

      Tasks: 11 (limit: 9098)

     Memory: 166.9M

        CPU: 1min 23.354s

     CGroup: /system.slice/apache2.service

             ├─  1785 /usr/sbin/apache2 -k start

Next you need to enable the Apache2 service (in modern Ubuntu/Debian it might be enabled by default)

sudo systemctl enable apache2

Even before we download Joomla you can start to prepare all configuration files on Apache.
I will now create a configuration file for Joomla called Joomla.conf on the following directory /etc/apache2/sites-available/

sudo vi /etc/apache2/sites-available/joomla.conf

Inside of this you can put something similar with the example bellow

<VirtualHost *:80>

    ServerAdmin This email address is being protected from spambots. You need JavaScript enabled to view it.

    DocumentRoot /var/www/joomla/

    ServerName blogfish.example

    ServerAlias www. blogfish.example

    ErrorLog ${APACHE_LOG_DIR}/error.log

    CustomLog ${APACHE_LOG_DIR}/access.log combined

 

    <Directory /var/www/joomla/>

            Options FollowSymLinks

            AllowOverride All

            Require all granted

    </Directory>

</VirtualHost>

After this file is create you need to enable the site and also disable the default site from Apache

sudo a2ensite joomla.conf

sudo a2enmod rewrite

sudo a2dissite 000-default.conf

Finally restart and check status of Apache

sudo systemctl restart apache2 ; sudo systemctl status apache2

Next is time to create the directories where we are going install and then download Joomla

sudo mkdir -p /var/www/joomla

To download first go to the web site https://downloads.joomla.org/ right click on download Joomla and copy the link

After you copied the link it’s time to use wget to download Joomla to the desired path

cd /var/www/Joomla

sudo wget https://downloads.joomla.org/cms/joomla5/5-1-0/Joomla_5-1-0-Stable-Full_Package.zip?format=zip (remove the part in red)

sudo unzip Joomla_5-1-0-Stable-Full_Package.zip ; sudo rm Joomla_5-1-0-Stable-Full_Package.zip

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

sudo systemctl restart apache2

 

Now if everything is configured correctly you should go to the server IP or localhost and see something like the images bellow

Name your website and choose a language

Create a login for your website

After you need to create the connection to the database with the credentials you create earlier

 

After the installation you should get a window like this and you are done installing Joomla.

 

For more information, please refer to: Joomla