How to Install Joomla Server on Ubuntu 20.04 (Setup Tutorial)

How to Install Joomla Server on Ubuntu 20.04 step by footstep tutorial.  Joomla is a complimentary, open up source and one of the most popular content management system around the world. Information technology is written in PHP and uses MySQL vs MariaDB as a database backend. It offers many features and thousands of plugins and templates or themes that help you to customize Joomla and extend its functionality. Joomla allows you lot to host different kinds of websites, blogs, and applications on the internet.

Joomla Features

  • Provides a lot of free and paid extensions and templates.
  • Supports a big community of developers, designers, etc.
  • Supports over seventy languages.
  • Used past 2 million websites effectually the world.
  • Supports two-cistron hallmark and advanced admission control features.

In this post, we volition explain how to install the Joomla server on Ubuntu 20.04.

Install Apache, MariaDB, and PHP

First, you volition require a web server to host the Joomla on the internet. You tin install the Apache webserver with MariaDB database server using the post-obit command:

          
            apt-get install apache2 mariadb-server -y
          
        

Later on installing both packages, run the following command to install PHP and other necessary PHP extensions:

          
            apt-get install php libapache2-modern-php php-cli php-mysql php-json php-opcache php-mbstring php-intl php-xml php-gd php-zip php-ringlet php-xmlrpc wget whorl -y
          
        

After the installation, verify the PHP version with the following command:

You lot will get the following output:

          
            PHP 7.4.3 (cli) (congenital: Nov 25 2021 23:16:22) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.four.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.iv.3, Copyright (c), past Zend Technologies
          
        

Next, edit the
php.ini
file and change some default settings:

          
            nano /etc/php/seven.4/cli/php.ini
          
        

Change the following values:

          
            memory_limit = 256M
upload_max_filesize = 128M
post_max_size = 128M
max_execution_time = 300
output_buffering = Off
date.timezone = UTC

            
          
        

Save and close the file then start the Apache and MariaDB service with the post-obit command:

          
            systemctl commencement apache2
systemctl start mariadb
          
        

Configure MariaDB Database

By default, the MariaDB database is not secured. And so it is recommended to secure it by running the
mysql_secure_installation
script:

          
            mysql_secure_installation
          
        

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

Ready root password? [Y/n] Y
New countersign: 
Re-enter new password: 
Password updated successfully!

Remove bearding users? [Y/due north] Y
Disallow root login remotely? [Y/due north] Y    
Remove test database and access to it? [Y/north] Y
Reload privilege tables at present? [Y/n] Y

            
          
        

Next, connect to the MariaDB shell with the post-obit command:

In one case yous are continued, create a database and user for Joomla with the following command:

          
            create database joomladb;
create user joomlauser@localhost identified by 'joomlapassword';

            
          
        

Side by side, grant all the privileges to Joomla database with the post-obit command:

          
            grant all on joomladb.* to joomlauser@localhost with grant option;
          
        

Next, reload the privileges and exit from the MariaDB beat with the following command:

Download Joomla

Kickoff, become to the Joomla website and download the Joomla stable version with the following command:

          
            wget https://downloads.joomla.org/cms/joomla4/4-0-3/Joomla_4-0-3-Stable-Full_Package.tar.gz?format=gz -O Joomla_4-0-iii-Stable-Full_Package.tar.gz
          
        

Once the download is completed, create a directory for Joomla and extract the downloaded file to the Joomla directory:

          
            mkdir /var/world wide web/html/joomla
tar -xvzf Joomla_4-0-3-Stable-Full_Package.tar.gz -C /var/www/html/joomla --strip-components=i
          
        

Next, change the ownership and permission of the Joomla directory:

          
            chown -R www-data:www-data /var/world wide web/html/joomla
chmod -R 755 /var/www/html/joomla
          
        

Create an Apache Virtual Host for Joomla

Adjacent, you will demand to create an Apache virtual host configuration file for Joomla. You can create it using the following control:

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

          
            <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>
          
        

Save and shut the file then verify the Apache for any syntax error with the following command:

You volition get the post-obit output:

Next, activate the Joomla virtual host with the following command:

Finally, restart the Apache service to utilize the changes:

          
            systemctl restart apache2
          
        

You can bank check the status of the Apache using the command given below:

You volition get the following output:

          
            ● apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: agile (running) since Wednesday 2022-01-05 15:21:20 UTC; 4s ago
       Docs: https://httpd.apache.org/docs/2.iv/
    Process: 15707 ExecStart=/usr/sbin/apachectl outset (code=exited, status=0/SUCCESS)
   Principal PID: 15722 (apache2)
      Tasks: 6 (limit: 2353)
     Retentiveness: xiii.3M
     CGroup: /organisation.piece/apache2.service
             ├─15722 /usr/sbin/apache2 -k start
             ├─15723 /usr/sbin/apache2 -thou start
             ├─15724 /usr/sbin/apache2 -thousand commencement
             ├─15725 /usr/sbin/apache2 -k first
             ├─15726 /usr/sbin/apache2 -m start
             └─15727 /usr/sbin/apache2 -k start

Jan 05 15:21:20 joomla systemd[1]: Starting The Apache HTTP Server...
          
        

Access Joomla Web Installer

Select your linguistic communication, provide your site name and click on the
Setup
Login
Data. You volition get the following screen:

joomla admin creation

Provide your Joomla admin username, password, e-mail address and click on the
Setup Databa Connection. Y’all volition get the following screen:

joomla-database-setup

Provide your database credentials and click on the
Install
Joomla. Once the Joomla has been installed, yous will become the following screen:

joomla installation finished

Click on the
Complete & Open Admin. You volition get the Joomla login screen:

Joomla login

Provide your Joomla admin user, password and click on the
Log in
. You will get the Joomla dashboard in the post-obit screen:

joomla-dashboard

Enable SSL on Joomla Website

Next, it is recommended to install the Permit’southward Encrypt SSL on the Joomla website. You tin install the Certbot Let’south Encrypt client packet using the following command:

          
            apt-get install python3-certbot-apache -y
          
        

In one case the Certbot packet is installed, run the following control to download and install the Let’s Encrypt SSL for your website.

          
            certbot --apache -d joomla.exampledomain.com
          
        

You will exist asked to provide your email and accept the term of service as shown beneath:

          
            Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator standalone, Installer None
Enter electronic mail accost (used for urgent renewal and security notices) (Enter 'c' to
abolish): hitjethva@gmail.com

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Delight read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.two-November-15-2017.pdf. You lot must
agree in order to register with the ACME server at
https://acme-v02.api.letsencrypt.org/directory
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(A)gree/(C)ancel: A

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing to share your electronic mail address with the Electronic Frontier
Foundation, a founding partner of the Let'due south Encrypt projection and the non-profit
organization that develops Certbot? We'd like to transport you e-mail virtually our work
encrypting the web, EFF news, campaigns, and means to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y
Plugins selected: Authenticator apache, Installer apache
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for joomla.exampledomain.com
Enabled Apache rewrite module
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/apache2/sites-available/joomla-le-ssl.conf
Enabled Apache socache_shmcb module
Enabled Apache ssl module
Deploying Certificate to VirtualHost /etc/apache2/sites-available/joomla-le-ssl.conf
Enabling bachelor site: /etc/apache2/sites-available/joomla-le-ssl.conf

            
          
        

          
            Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS admission. Cull this for
new sites, or if you're confident your site works on HTTPS. You can disengage this
modify past editing your web server's configuration.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the advisable number [i-2] then [enter] (press 'c' to abolish): two
          
        

Type
2
and hit
Enter
to install the Let’due south Encrypt SSL for your website:

          
            Enabled Apache rewrite module
Redirecting vhost in /etc/apache2/sites-enabled/joomla.conf to ssl vhost in /etc/apache2/sites-bachelor/joomla-le-ssl.conf

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You take successfully enabled https://joomla.exampledomain.com

Yous should test your configuration at:
https://world wide web.ssllabs.com/ssltest/analyze.html?d=open.exampledomain.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/joomla.exampledomain.com/fullchain.pem
   Your central file has been saved at:
   /etc/letsencrypt/live/open.exampledomain.com/privkey.pem
   Your cert volition expire on 2022-04-xi. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot again
   with the "certonly" selection. To non-interactively renew *all* of
   your certificates, run "certbot renew"
 - If you like Certbot, please consider supporting our work by:

   Altruistic to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le
          
        

Now, you can admission your Joomla website securely using the URL
https://joomla.exampledomain.com.

How to Install Joomla Server on Ubuntu xx.04 Conclusion

In the higher up guide, nosotros explained how to install Joomla with Apache on Ubuntu 20.04. We too explained how to enable SSL on the Joomla website using Let’s Encrypt. I hope this will help you to deploy Joomla in the production environment.

How to Install Joomla Server on Ubuntu 20.04 (Setup Tutorial)

Source: https://cloudinfrastructureservices.co.uk/how-to-install-joomla-server-on-ubuntu-20-04-setup-tutorial/