Joomla is a popular open source content management system (CMS) used by millions of people around the world to create website content and online applications.
It’s a free CRM that’s easy to use, making it a great choice if you are new to website development. Joomla! is administered via a web-based interface, and can be installed on any server with PHP and MySQL support.
In this guide, we’ll show you how to install Joomla on an Ubuntu 22.04 VPS, or dedicated server.
How to Install Joomla on an Ubuntu 22.04
To install Joomla on an Ubuntu 22.04 VPS or dedicated server, update Ubuntu system packages, then install Apache and PHP. Create a Joomla database and database user before downloading Joomla from the Joomla downloads site. Unzip the Joomla file and configure Apache for Joomla. Finally, install Joomla and test the installation to ensure it works well.
Key Takeaways:
Here are the key takeaways from this guide on how to install Joomla on an Ubuntu 22.04 server.
You need to update your server’s package repository and upgrade any existing packages to their latest versions before you start installing Joomla.
You need to install Joomla dependencies (Apache, PHP, and MySQL) together with their associated modules before installing the software.
Since Joomla needs a database to store its data, you’ll also need to create a Joomla database and a user with access permission to the database.
You can download the latest version of Joomla from theJoomla downloads page and select your preferred download format.
After downloading and configuring Joomla, you can install it on your web server and start using it to create website content.
Prerequisites
Before installing Joomla on Ubuntu 22.04, you need the following:
A VPS (Ubuntu 22.04VPS) or dedicated server hosting plan
A domain or subdomain connecteD to you server IP
A VP user with sudo privileges or full SSH root access
Step 1: Install Apache
The first step is to install Apache.
However, it’s always advisable to update your server’s package repository and upgrade any existing packages to their latest versions before you start the installation.
You can do this by running the following commands:
apt-get update
After updating your server packages, install Apache by running the command below:
apt-get -y install apache2
This command will install Joomla’s dependencies, as well as some other common PHP modules that Joomla requires.
Step 2: Install MySQL
Joomla is written in the PHP programming language and uses the MySQL database to store data.
You’ll also need to install both of these dependencies before you can install Joomla.
To install MySQL, run the following command:
apt-get -y install mysql-server
You’ll be prompted to enter a password for the root user. Be sure to enter a strong password.
Since the default MySQL installation is not secure, run the command below to remove anonymous users and test databases.
NOTICE: As of July 2022, trying to run mysql_secure_installation without taking some step would raise an error that will lead you to an everlasting loop.
We need to undertake some steps beforehand to allow the mysql_secure_installation scripts to execute some actions that help to keep your server secure.
To avoid this loop of errors, we’ll take the steps below:
Access mysql:
Then launch the following query
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
Replace the password with whatever pass you want to use
Then, exit mysql
Note: You can test your password strength beforehand with the VALIDATE_PASSWORD_STRENGTH mysql function.
Examples:
Now, you are free to execute mysql_secure_installation without running into errors.
The last answer will also be ‘Yes’ to reload privileges and apply the changes made:
Next, you want to revert the root auth method back to the original one (auth socket). To do that, execute the following command, where you’ll be asked for the mysql root password that you just configured:
mysql -uroot -p -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH auth_socket;"
Note: If, for whatever reason, you need to disable the password validation policy, launch the command:
mysql -uroot -p -e "UNINSTALL COMPONENT 'file://component_validate_password';"
You can obtain a list of the components installed as below:
Step 3: Create a Database for Joomla
Next, you need to create a database where Joomla will store data:
You’ll also need to create a Joomla database user and grant them access to the Joomla database that you create.
In this guide, we will call our Joomla database user ‘joomlauser’
Log in on the MySQL Command Line Interface(CLI) using the commands below:
mysql -u root -p
Enter your root password and hit Enter.
Now, create the database user and assign the right privileges using the commands below:
CREATE DATABASE joomla;
CREATE USER 'joomla_user'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON joomla.* TO 'joomla_user'@'localhost';
FLUSH PRIVILEGES;
QUIT;
Remember to replace ‘joomla_user’ with your preferred value. Also, you should set a strong password for the user.
Step 4: Install PHP
Joomla is written in PHP – a server-side general-purpose scripting language.
So, you need to install PHP as well, together with associated modules tailored for the Apache web server, using the commands below:
Now that our web server, database server, and Joomla user are configured, we can download the Joomla files.
Joomla is available for download from the Joomla downloads page. From Joomla’s downloads page, select the latest version and your preferred format for downloading Joomla from Joomla’s downloads page. At the time of writing, the latest stable version is Joomla 4.3.2.
For this guide, we will download Joomla in its .zip format. Once you have selected your preferred format, click on the “Download” button to download Joomla’s codebase.
Since the download will be a zip archive, you should begin by installing the unzip tool.
apt-get -y install unzip
Next, cd to the ‘/tmp’ directory and download the latest version of Joomla (4.2.3 at the time of writing) from the official website.
cd /tmp
wget
https://downloads.joomla.org/cms/joomla4/4-2-3/Joomla_4-2-3-Stable-Full_Package.zip?format=zip
Joomla will be downloaded and stored under the archive file ‘Joomla_4-2-3-Stable-Full_Package.zip’
You need to unzip this file and copy it to the root of your website, probably under a directory name like ‘joomla’. You can use any name for this.
Restart Apache for all the PHP settings to take effect:
systemctl restart apache2
Run the following command to check if apache is running:
systemctl status apache2
Step 7: Finalize Joomla Installation via a browser.
Now that Joomla is downloaded and configured, you can install it on your web server.
Navigate to the URL ‘http://example.com/joomla’ on your browser.
Remember to replace ‘example.com’ with your domain name or the public IP address of your server.
To obtain your IP address, you can issue the following command:
hostname -I.
Then enter your site name and select language:
Fill out the fields on this page with your Joomla site’s information. The only required field on this page is the “Site Name” field.
Press Setup Login Data to advance to the following step, where you will be asked to fill in some data to create your admin account (name, username, email and password).
Press Setup Database Connection to continue to the following steps where we will fulfill the form with the mysql user we created at the end of step 3
Now, press Install Joomla to proceed.
Joomla will take a few moments to install. Once it is finished, you should see the Joomla installation complete page:
The setup wizard will finalize the installation and you will get a congratulations message:
At this point, Joomla is installed and ready to use.
Click on the “Remove Installation Folder” button to remove Joomla’s installation files. You will be taken to Joomla’s administration login page:
Step 8: Test the Installation
After completing the installation process, test the installation to ensure it works as expected.
You will have to links to test both, admin access and the main web page:
The “Open Site” will take you to the main page (which is yourdomain/joomla):
Whereas the “Open Administor” will take you to the admin login page (yourdomain/joomla/administrator )
Use the username and password that you created during Joomla’s installation process to log in to Joomla’s admin panel.
From here, you can begin configuring your Joomla site.
Conclusion
We have accomplished installing Joomla on Ubuntu 22.04 server. You can now start posting content or probably install a new theme to make your website look more professionals.
Joomla is a great content management application that you can utilize to create beautiful websites. If you’ve followed this guide step-by-step, your Joomla site should be up and running.
Yes, Joomla runs on Apache web server and that’s why you need to install Apache and other Joomla dependencies before installing the software. Apache is among the most popular source web servers available today.
How do I access Joomla Admin?
You can access the Joomla admin page by typing your website address followed by “/administrator.” You then input your username and password and click the “Login” button to continue to the admin page.
Does Joomla work with MariaDB?
Yes. Joomla can work with MariaDB as its database. MariaDB version 10.1 is the most recommended since it’s equal to MySQL 5.6.