In this post, we will show you how to install Joomla on an Ubuntu 18.04 VPS with MySQL, PHP-FPM 7.2, and Nginx.
Joomla is a free and open-source content management system (CMS) for publishing web content written in PHP. Joomla is one of the most popular CMSs and it is used all over the world to power millions of websites of all shapes and sizes. Joomla can be used for small business and corporate websites, e-commerce stores, online magazines, personal blogs and portfolios and much more.
This guide should work on other Linux VPS systems as well, but it was tested and written for an Ubuntu 18.04 VPS.
Table of Contents
Prerequisites:
- Ubuntu 18.04 VPS
- Administrative sudo user with root privileges, or access to the root user itself
Before you start:
Run the following command to update the packages list and upgrade the system packages:
Install the necessary packages:
Step 1: Install MySQL and Create a Database
If you already have MySQL or MariaDB installed, you can skip this step and move onto the next one.
The following command will install the latest MySQL 5.7 server from the official Ubuntu repositories:
Once the installation is complete, issue the following command to secure your installation:
You will be prompted to answer several questions. These are the values we would use, but you are free to answer them based on your preferences:
- Setup VALIDATE PASSWORD plugin? (Press y|Y for Yes, any other key for No) N
- Change root password? (Press y|Y for Yes, any other key for No) N
- Remove anonymous users? (Press y|Y for Yes, any other key for No) Y
- Disallow root login remotely? (Press y|Y for Yes, any other key for No) Y
- Remove test database and access to it? (Press y|Y for Yes, any other key for No) Y
- Reload privilege tables now? (Press y|Y for Yes, any other key for No) Y
Next, we need to create a MySQL database and user for the new Joomla installation.
Log in to the MySQL console:
Run the following commands to create a new database and user and to grant privileges to the user:
Make sure to replace “my_strong_password” with an actual strong password.
Step 2: Install PHP 7.2 and Required PHP Modules
The newer Joomla versions are fully compatible with the default PHP version 7.2 that comes with Ubuntu 18.04.
Install PHP 7.2 and all necessary PHP modules using the following command:
Set the recommended PHP settings for Joomla:
Step 3: Install Joomla
Installing Joomla is pretty easy and straightforward. First, download the Joomla zip archive from the Joomla download page:
Once the download is completed, unzip the archive and move the extracted files to the /var/www/myjoomlasite.com
directory, which will be the root directory of your new Joomla site:
Make sure to replace “myjoomlasite.com” with the name of your unique registered domain name.
Finally change the ownership of the /var/www/myjoomlasite.com
directory to the www-data
user so that PHP and Nginx can read, write to, and edit files:
Step 4: Install and Configure Nginx
If you don’t have Nginx installed on your server, you can install the latest stable version from the official Ubuntu repositories:
Next, create a new Nginx server block:
Activate the server block by creating a symbolic link:
Once again, pay attention to replacing the example domain name with your unique one.
Test the Nginx configuration and restart the nginx service:
Open http://myjoomlasite.com/
in your favorite web browser and follow the on-screen instructions to complete the Joomla installation.
That’s it. You have successfully installed Joomla on Ubuntu 18.04! For more information about how to manage your Joomla installation, please refer to the official Joomla documentation.
Of course, you don’t have to install Joomla on Ubuntu 18.04 if you use one of our managed VPS hosting services or one of our Managed Joomla Hosting services, in which case you can simply ask our expert Linux admins to setup this for you. They are available 24×7 and will take care of your request immediately.
PS. If you liked this post on how to install Joomla on Ubuntu 18.04, or if you found it helpful, please share it with your friends on the social networks using the sharing buttons, or simply leave a reply below. Thanks.
Before granting privileges to the user joomla, I needed to create the user:
CREATE USER ‘joomla’@’localhost’ IDENTIFIED BY ‘my_strong_password’;