How to Install Joomla on an Ubuntu 22.04 VPS or Dedicated Server

How to Install Joomla on an Ubuntu 22.04 VPS or Dedicated Server

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.

  1. You need to update your server’s package repository and upgrade any existing packages to their latest versions before you start installing Joomla.
  2. You need to install Joomla dependencies (Apache, PHP, and MySQL) together with their associated modules before installing the software.
  3. 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.
  4. You can download the latest version of Joomla from the Joomla downloads page and select your preferred download format.
  5. 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.

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

apt-get -y install php libapache2-mod-php

apt-get -y install php-cli php-common php-mbstring php-gd php-intl php-xml php-mysql php-zip php-curl php-xmlrpc

Step 5: Install Joomla

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.

So first, you make the directory

mkdir /var/www/html/joomla.

Then, unzip the file

unzip Joomla_4-2-3-Stable-Full_Package.zip -d /var/www/html/Joomla.

Step 6: Configure Joomla and Assign the Right File Permissions

Now that the Joomla files are extracted, you can start configuring Joomla for your environment.

The default Joomla installation comes with a ‘htaccess.txt’ which we should copy to create a ‘.htaccess’ file. Use the commands below to do this:

cp /var/www/html/joomla/htaccess.txt /var/www/html/joomla/.htaccess

First, you’ll need to change the ownership of the Joomla files to the Apache user to allow the user to access the files.

You can do this with the following commands:

chown -R www-data.www-data /var/www/html/joomla
chmod -R 755 /var/www/html/joomla

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.

You can also read about Joomla versus wordpress to find out the best CMS for your needs.

Next Steps: What Now?

Now that we’ve come to the end, here are some practical steps you can take from this tutorial:

Further Reading

Here are more valuable resources to learn about Joomla and how to install and use it to create beautiful websites:

  1. https://blog.templatetoaster.com/what-is-joomla/
  2. https://www.dreamhost.com/blog/beginners-guide-to-joomla/
  3. https://www.rosehosting.com/blog/how-to-install-joomla-on-ubuntu-22-04/
  4. https://www.linuxtuto.com/how-to-install-joomla-4-on-ubuntu-22-04/
  5. https://hostadvice.com/how-to/how-to-install-joomla-on-an-ubuntu-18-04-vps-or-dedicated-server/

FAQs

Does Joomla use Apache?

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.

How To Set up a VSFTPD Server on a CentOS 7 VPS or Dedicated Server

Brief Description FTP is usually insecure exposing clear-text passwords, userna
2 min read
Eliran Ouzan
Eliran Ouzan
Web Designer & Hosting Expert

How To Set up a VSFTPD Server on an Ubuntu 16.04 VPS or Dedicated Server

Brief Description FTP data is usually insecure since information (usernames, pa
2 min read
Eliran Ouzan
Eliran Ouzan
Web Designer & Hosting Expert

How to use phpMyAdmin to develop a website (without MySQL experience)

Brief description A web developer who is not well versed into coding websites f
2 min read
Idan Cohen
Idan Cohen
Marketing Expert

How to Install MySQL on a Windows Web Server Running Apache

This tutorial will show you how to install the MySQL database on a Windows serve
3 min read
Michael Levanduski
Michael Levanduski
Expert Hosting Writer & Tester
HostAdvice.com provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.
Click to go to the top of the page
Go To Top