How to install Joomla 3 on a Linux VPS Server
Written by Kostas Mavrokefalos
Hosting a web site on a shared hosting environment is convinient, but doesn't give you the flexibility we sometimes need. This is a case when we need to access the server directly like changing file permissions or run a Python script on the server. In a shared host environment the user only has access to the File Manager through a cPanel (if available) and that's all. Moreover the VPS servers are relative cheaper. A quick Duck Duck Go :) search will provide you with a lot of results starting from even $5/month.
Also a VPS server is, at least in theory, faster than a Shared Hosting Environment. Generally speaking if you need total freedom you will find it difficult to stay in a Shared Host. Now that i convinced you let's go to our tutorial!
I will try to keep the process as fast as possible and try to avoid the picture approach or video. I suppose the user knows how to use the Terminal and troubleshoot any errors. The process is rather long and all i wanted is a quick guide to do this with all the small details that might appear (like permission assignment) that sometimes are forgotten or haven't been tested on the process. So for that reason i have cloned the whole process, but there is strong possibility you find small differences. I will be happy to read your comments and add/correct commands that would work more globally for a bigger variety of systems.
So the scenario is that we have just bought some VPS hosting from some online company and we want to install Joomla! on an absolutely empty linux server.
In the first place we need to buy a VPS from some provider. Like i mentioned this can be really cheap and you can have some options here:
Next we need to open a terminal (Ctrl+Alt+T) and type
ssh [email protected]_ADRESS_OF_YOUR_VPS
apt-get install sudo unzip
We need to create the user (let's name it solomon):
useradd -m -s /bin/bash solomon
-m option will create a folder named solomon inside the home directory of your account
-s option will define the default shell to be bash
We need to change the user password (let's call it solomon):
We need to place the user we just created into the SUDO: We type
visudoand then in the edit screen under
#allow memberswe add
ALL=(ALL:ALL) ALLand SAVE
Prevent the root user from login with SSH:
We need to find the command
PermitRootLogin noand set it to no.
Save & Exit
We login again as the new user:
ssh [email protected]_ADRESS_OF_YOUR_VPS
Now we need to install some usefull programmes:
sudo apt-get install apache2 mysql php5
We will get a window asking for the mySQL Password (Note this down because it is very important)
Install some more scripts:
sudo apt-get install php5-gd php5-mysql
Now we are ready to install Joomla!
We create the necessary directories:
Get joomla from the website: (You need to go to https://downloads.joomla.org/ and copy link adress with your mouse in order to have the latest version of joomla- for me it is 3-6-5)
sudo mkdir joomla
We unzip the file
sudo unzip /home/solomon/bin/joomla/joomla_3-6-5-stable-full_package-zip
Now we have to change the ownership of the folder so www-data owns it:
chown www-data:www-data ./joomla/
We create the database user, the database and assign the user to the database:
mysql -u -root -p
-u option:means user
-p option:means password
Now we have entered the mySQL terminal - We need to create a user and assign a password:
CREATE USER 'joomla_user'@'localhost' IDENTIFIED BY 'we_define_a_password_here';
We create the database:
CREATE DATABASE joomla_db;
GRANT ALL PRIVILEGES ON joomla_db.* TO 'joomla_user'@'localhost';
This is the end of the Tutorial. I am positive it contains all the necessary steps to perform the task. Implications might appear for different system Hardware Setups and different Linux Distributions, but it is unlikely. The commands are Standard Linux Network Administration Commands.
The benefit of having this task performed fast and the flexibility to have an easy to read and execute Walkthrough has been my motivation
Hope you enjoy it and i am very welcome to comments and suggestions.
Resources: The top image was downloaded from:https://alpha.wallhaven.cc Usefull info: https://docs.joomla.org/Creating_A_VPS_Testing_Server