How to Install Joomla on Ubuntu 21.04
LTS
Like any other site builder system, Joomla site builder will allow you to build a site. As you know, to create a site on the Internet, after purchasing hosts and domains, you need to choose a suitable site builder who can install data on the hosts and connect to the database to be able to put data in it. Joomla is actually a free, user-friendly, and easy CRM and if you are a beginner, Joomla is a great choice for you. Here, we will show how you can install Joomla on Ubuntu 21.04 LTS.
Introduction to Joomla
Joomla is a free, open-source content management system released under the GNU/GPL License. Joomla is built with PHP programming language uses an MVC-based framework and uses the MySQL database to store data. Types of small and large business websites, online businesses, e-service portals, government agency websites, educational websites, e-learning portals, websites News, and even small personal websites are implemented by Joomla.
We will introduce you to the prerequisites for installing Joomla on Ubuntu Linux VPS.
Prerequisites to Install Joomla on Ubuntu 21.04
First of all, you need to update the system packages and repositories. To update the system, enter the following commands:
sudo apt update -y
sudo apt upgrade -y
Then it is necessary to add the repository by running the following command:
sudo apt-add-repository ppa:ondrej/php
You need to install PHP because Joomla is written in PHP and stores data in MySQL. You must also install Apache, as the Apache webserver serves Joomla pages, and users can access any Joomla Site through a browser.
Now you can Install PHP by running the following command:
sudo apt install apache2 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
Enter the following command to verify the installed Apache version:
sudo dpkg -l apache2
Now start the Apache server, using the command below:
sudo systemctl start apache2
You can also enable Apache with the following command:
sudo systemctl enable apache2
You can confirm Apache is running by entering the following command:
sudo systemctl status apache2
In this step, after heading over to your browser, you have to type the IP address in the URL bar:
http://server-IP
Tip: This image shows that Apache is installed and running.
You must confirm the PHP installation by running the following command:
php -v
Joomla needs a database in the backend to store its data. To do this, you must install the MariaDB relational database server, which is a FORK of MySQL. MariaDB is an open-source and free database.
You can install MariaDB by running the following command:
sudo apt install mariadb-server
Enter the following command to secure the MariaDB database engine:
sudo mysql_secure_installation
When you are asked for the root password, you have to hit Enter. By pressing “Y” you can set the root password.
To strengthen its security, just type “Y” for the remainder of the section and finally press Enter to set its recommended settings.
You must first log in to MariaDB to create a database to store files. Enter the following command:
sudo mysql -u root -p
You should create the database, and database user, and grant privileges to the database user, enter the following commands:
MariaDB [(none)]> CREATE DATABASE joomla; MariaDB [(none)]> GRANT ALL PRIVILEGES ON joomla.* TO 'joomla'@'localhost' IDENTIFIED BY 'StrongPassword'; MariaDB [(none)]> FLUSH PRIVILEGES; MariaDB [(none)]> EXIT;
How to Install Joomla on Ubuntu 21.04
In this step, you can easily download the Joomla installation package by entering the following command:
sudo wget https://downloads.joomla.org/cms/joomla3/3-9-26/Joomla_3-9-26-Stable-Full_Package.zip
To make the directory you can name the list “Joomla” or whatever name you want:
sudo mkdir /var/www/html/joomla
Now you must unzip the Joomla file. To do this, run the following command:
sudo unzip Joomla_3-9-26-Stable-Full_Package.zip -d /var/www/html/joomla
In this step, you can set the directory ownership of the directory to the Apache user by entering the following command:
sudo chown -R www-data:www-data /var/www/html/joomla
Run the following command to change permissions:
sudo chmod -R 755 /var/www/html/joomla
Now you need to restart the Apache server with the following command to apply the changes:
sudo systemctl restart apache2
How to Configure Apache for Joomla
To configure Apache for Joomla, you must first create a virtual host file for Joomla and name it Joomla.conf:
sudo vim /etc/apache2/sites-available/joomla.conf
Now you need to enter the following configuration in the file and save it.
<VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /var/www/html/joomla/ ServerName example.com ServerAlias www.example.com 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>
To enable the virtual host’s file, run the following commands:
sudo a2ensite joomla.conf
sudo a2enmod rewrite
Restart the Apache webserver service with the following command to apply the changes:
sudo systemctl restart apache2
How to Setup and Run Joomla on Ubuntu 21.04
To finalize the Joomla installation, launch Joomla through a web browser. To do this, browse your server URL according to the following command:
http:// server-IP/joomla
After opening the webpage, you must fill in the required details and then click “Next“:
On this page, you have to fill in the database details and click “Next“.
Since this page shows an overview of all the settings, you can do a pre-installation check:
Refer to the “Pre-installation Check” and “Recommended settings” sections to confirm the required installation packages and the correct settings:
Click “Install“.
After the installation is completed menu, you will receive a Joomla Installation notification.
You must delete the installation folder before logging in. To do this, scroll down and click on “Remove installation folder“.
Click on “Administrator” to log in:
Click “Log in” after entering your username and password. You are now logged in to the Joomla Dashboard.
Well Done! The Joomla Installation process on Ubuntu 21.04 is completed.
Troubleshooting Some Common Issues of Joomla on Ubuntu
Joomla is a popular content management system (CMS), and like any software, it can encounter common issues. Here are some common issues about Joomla and their solutions:
1- When you access your Joomla site, you see a blank white screen.
Solution:
– Enable error reporting in Joomla’s configuration.php file by changing public $error_reporting = ‘none’; to public $error_reporting = ‘maximum’;.
– Check the PHP error logs (/var/log/php/error.log or as specified in your PHP configuration) for details about the error causing the WSOD.
2- Joomla can’t connect to the database.
Solution:
– Verify that your database credentials (username, password, hostname, and database name) in Joomla’s configuration.php file are correct.
– Ensure the MySQL or MariaDB service is running on your Ubuntu server.
– Check for any database server-related errors in MySQL/MariaDB logs.
3- Joomla encounters permission issues when trying to write to files or directories.
Solution:
– Make sure that Joomla has the necessary permissions to write to its directories, especially the tmp and logs folders. You can use the chmod command to adjust permissions.
– Set the correct ownership of Joomla files and directories using chown and chgrp.
4- Your Joomla site is slow to load.
Solution:
– Optimize your database by cleaning up unused data and optimizing tables.
– Use caching mechanisms provided by Joomla or install a caching extension.
– Consider using a Content Delivery Network (CDN) for static assets.
Conclusion
Use Joomla for your small business and expand it as needed. With knowledge of HTML, you can maintain your Joomla site. You don’t have to be a programmer to use it. But you can use Joomla to build your site easily and then create blogs and plugins. Also, an attractive point is that you can improve the appearance of your site too. If you enjoy reading this article, feel free to share your ideas and questions. GoodLuck!
You might like it