Joomla is a PHP based content management system (CMS) that allows you to build websites easily and offers many different templates for blogs, commerce, marketing, etc. Today we will be installing Joomla on Ubuntu 20.04.
First, if you would like to make your website accessible remotely please click on link below to purchase a public IP address.
How to Purchase and Activate a Dedicated Public IP Address for your Shell™
Prerequisites – Installing a Lamp Stack
Let's open up a terminal by selecting and searching for terminal up top in search bar and clicking on the icon to open a session and update our system packages.
sudo apt update
Now we can install Apache, Mysql and PHP
sudo apt-get install apache2 mysql-server php7.4
Next, let's start, enable, and check the status of Apache
sudo systemctl start apache2
sudo systemctl enable apache2
sudo systemctl status apache2
Enabling UFW firewall for Apache webserver
If you have purchased a public IP, lets go ahead and enable the firewall to allow traffic on http port 80
sudo apt install ufw
sudo enable ufw
sudo ufw allow http
Once we have started UFW, and enabled it, let's check the status of firewall
sudo status ufw
Next, let's install dependencies needed
sudo apt-get install php zip libapache2-mod-php php-gd php-json php-mysql php-curl php-mbstring php-intl php-imagick php-xml php-bcmath php-gmp php-xmlrpc
After that, let's create a MySQL root password using the command below following the steps instructed as it will give you a series of questions to answer yes or no to for a security purposes.
sudo mysql_secure_installation
Joomla – Create Database
Next step is to create a database for Joomla so lets login to MySQL
sudo mysql -u root
Once you are in the mysql> prompt create the database. In this example I am using joomla (database name), shells_user (database username), My$hell123 (database password), however, it is recommended that you use your own credentials for this step for security.
CREATE DATABASE joomla;
CREATE USER 'shells_user'@'localhost' IDENTIFIED BY 'My$hell123';
GRANT ALL PRIVILEGES ON joomla.* TO 'shells_user'@'localhost';
FLUSH PRIVILEGES;
exit
Configuring Apache and Joomla
Next we will update the php.ini configuration file to increase file size and memory limit. I will be using nano text editor for this.
sudo nano /etc/php/7.4/apache2/php.ini
Update the following to php.ini file
memory_limit = 256M
upload_max_filesize = 128M
post_max_size = 128M
max_execution_time = 300
output_buffering = Off
After the php.ini file is updated, let's download the latest Joomla version using wget
wget https://downloads.joomla.org/cms/joomla3/3-9-24/Joomla_3-9-24-Stable-Full_Package.tar.gz
Next, we are going to make a directory for our Joomla files
sudo mkdir /var/www/html/joomla
After that, we will extract our Joomla folder using tar and move it to /var/www/html/joomla
sudo tar xzf Joomla_3-9-23-Stable-Full_Package.tar.gz -C /var/www/html/joomla
You can verify the Joomla files by doing an ls
cd var/www/html/joomla
ls
You should see the following above
Now, let's change ownership of our Joomla directory so we don’t run into any permission issues
sudo chown -R www-data:www-data /var/www/html/joomla
Next, we will create a virtual host .conf file for joomla.
sudo nano /etc/apache2/sites-available/joomla.conf.
Paste the following into the joomla.conf file below.
ServerName localhost
<VirtualHost *:80>
ServerAdmin admin@localhost
DocumentRoot /var/www/html/joomla/
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 exit and check for syntax errors with the following command
apachectl -t
If no syntax errors, you should get an output like below
Disabling Apache’s default site and enabling Joomla's site
a2dissite 000-default.conf
a2ensite joomla.conf
After that reload Apache
sudo systemctl restart apache2
Final Steps
Now we should be able to access Joomla with http://localhost or your assigned public IP/hostname if you have configured for remote access. Once on the website, follow the steps to complete your setup: 1. Configuration 2. Database 3. Overview.
Conclusion
If installation is finalized, you should see something similar to this site below.
And that’s it. You can now create your own websites using Joomla. Joomla is a robust content management system. If you would like to learn more, please visit click on the link below