Share your love
Install and Configure Joomla on Ubuntu 20.04
In this article, we want to teach you How To Install and Configure Joomla on Ubuntu 20.04.
Joomla is an open-source Content Management System (CMS) used to build websites and online applications. It is free, extendable, and separated into front-end and back-end templates (administrator). Joomla is developed using PHP, Object-Oriented Programming, software design patterns, and MySQL (used for storing the data).
Install and Configure Joomla on Ubuntu 20.04
To install Joomla on Ubuntu 20.04, you need some requirements.
Requirements
First, you must log in to your server as a non-root user with sudo privileges and set up a basic firewall. To do this, you can follow our guide the Initial Server Setup with Ubuntu 20.04.
Then, you must have LAMP Stack installed on your server. To do this, you can check our guide How To Install LAMP Stack on Ubuntu 20.04.
Now follow the steps below to complete this guide.
Create a Joomla Database on Ubuntu 20.04
First, you need to log in to your MariaDB or MySQL shell with the following command:
sudo mysql -u root -p
Then, from your MariaDB shell, run the following command to create a Joomla database on Ubuntu 20.04, here we named it joomla_db:
MariaDB [(none)]> CREATE DATABASE joomla_db;
Now you need to create a Joomla user and grant all the privileges to it, here we named it joomla_user:
MariaDB [(none)]> GRANT ALL PRIVILEGES ON joomla_db.* TO 'joomla_user'@'localhost' IDENTIFIED BY 'password';
Flush the privileges and exit from your MariaDB shell:
MariaDB [(none)]> FLUSH PRIVILEGES; MariaDB [(none)]> EXIT;
Install and Configure PHP Extensions
At this point, you need to install some PHP extensions on your server with the following command:
sudo apt install php-common libapache2-mod-php php-cli php-fpm php-mysql php-json php-opcache php-gmp php-curl php-intl php-mbstring php-xmlrpc php-gd php-xml php-zip
Then, you need to make some configuration changes to your php.ini file. Open the file with your favorite text editor, here we use vi:
sudo vi /etc/php/7.4/fpm/php.ini
Find the line below and change their value as shown below:
memory_limit = 512M upload_max_filesize = 256M post_max_size = 256M max_execution_time = 300 output_buffering = off date.timezone = Europe/Berlin
Remember to put your current time zone in the file.
When you are done, save and close the file.
Set up Joomla on Ubuntu 20.04
Now you can start to install Joomla on your server. First, visit the Joomla Downloads Page and get the Full zip package of the latest version of Joomla.
wget https://downloads.joomla.org/cms/joomla4/4-1-4/Joomla_4-1-4-Stable-Full_Package.zip?format=zip
When your download is completed, unzip your downloaded file in the /var/www/html/joomla directory with the command below:
sudo unzip Joomla_4-1-4-Stable-Full_Package.zip?format=zip -d /var/www/html/joomla
Then, set the correct permissions and ownership to your Joomla directory:
sudo chown -R www-data:www-data /var/www/html/joomla
sudo chmod -R 755 /var/www/html/joomla
At this point, you need to configure the Apache webserver to serve Joomla web pages. To do this, create a virtual host file for Joomla with your favorite text editor, here we use vi:
sudo vi /etc/apache2/sites-available/joomla.conf
Add the following contents to the file:
Use the server’s Fully Qualified Domain Name (FQDN).
<VirtualHost *:80>
ServerAdmin admin@exampledomain.com
DocumentRoot /var/www/html/joomla/
ServerName joomla.exampledomain.com
ErrorLog ${APACHE_LOG_DIR}/joomla-error.log
CustomLog ${APACHE_LOG_DIR}/joomla-access.log combined
<Directory /var/www/html/joomla/>
Options FollowSymlinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
When you are done, save and close the file.
Next, enable the Joomla virtual host file on Ubuntu 20.04 with the following command:
sudo a2ensite joomla.conf
Restart Apache to apply the changes:
sudo systemctl restart apache2
Access Joomla Web Interface
At this point, you can continue your Joomla installation on Ubuntu through the web interface.
Enter your server’s IP address or domain name in your web browser:
http://server-ip or domain.com
You will see your Joomla installer. Select your desired language and enter your Joomla site name and click Set up login data.
Next, you need to enter your login data and click Setup database connection.
Next, enter the database credentials that you have provided before on Ubuntu 20.04 and click Install Joomla.
When your installation is completed, you will see the following screen. Click Open Administrator.
Then, enter your Joomla super username and password and click Login.
At this point, you will see your Joomla dashboard.
From here, you can create and customize your blog or website using various themes and plugins to your preference.
Conclusion
At this point, you learn to Install and Configure Joomla on Ubuntu 20.04.
Hope you enjoy using it.