WordPress, as we’ve seen time and again, is one of the most preferred Content Management Systems with over 33% websites across the globe and WordPress Hosting as the preferred hosting. However, depending on your website’s needs and traffic, you may or may not be using WordPress Hosting. Out of the various hosting options available let us assume, you have opted for Virtual Private Server (VPS) Hosting and now wish to install WordPress. Sounds complex doesn’t it? Worry not, it isn’t!
In this tutorial, I’ll walk you through how to install WordPress on VPS Hosting in simple steps. All you need to do is follow these steps and voila your WordPress is installed!
For your benefit, I have divided the post into three sub-parts:
- Placing the orders
- Installing WordPress on WHM (with a Control Panel)
- Installing WordPress without a Control Panel
So without further ado, let us begin.
- Placing the orders
The first step before you can install WordPress on VPS is to purchase the domain name and VPS Hosting. We will be purchasing the above from our ResellerClub Control Panel.
Step 1: Login to our Control Panel, using your Reseller ID and Password. Go to the top right side of the dashboard and click on Buy to purchase orders.
- To purchase a domain, go to ‘Select Product’ and select Domain Registration from the drop-down list
- Enter the domain you want and check if it is available. You can even add Privacy Protection at an added cost
- Once you’ve purchased your domain name it is time for you to purchase your hosting. In the same ‘Select Product’ drop-down, select Linux KVM VPS
- Type the domain name you want to link the hosting with, as well as, all the product specification details as well
- Next, choose if you want any Add-ons, the control panels viz. cPanel and Plesk and, WHMCS Add-ons available with VPS Hosting. We have selected cPanel and WHMCS.Note: Should you not want any Add-ons, you can select None
- Pay the amount and you have successfully purchased the order
Step 4: Now that you’ve purchased your domain name and VPS Hosting, it automatically gets added to your control panel.
To access the orders, go to the main dashboard and click on Products → List All Orders → Click on the order you want to access.
Since we want to install WordPress on VPS Hosting, we have selected that order. After clicking on the order name, a new window opens where you can modify the order, as seen in the image below.
Click on the ‘Admin Details’ tab and a new window opens. You can now access the Server Management Panel, WHMCS and cPanel.
As seen above, our orders have been purchased and we will now see how to install WordPress. Since at the time of purchase we had purchased cPanel as the preferred control panel Add-on, we will first see how to install WordPress on WHM (the backend of cPanel). However, if you have not installed a control panel, then we will even show you how to go about installing WordPress without it.
- Installing WordPress on WHM (with a Control Panel)
Since we purchased the cPanel Add-on we can now access WHM. Softaculous is an Auto Installer that can be integrated easily into control panels like cPanel, Plesk, DirectAdmin etc. It is one of the easiest ways to install applications like WordPress, Drupal, phpBB, etc. with a single click. However, Softaculous is not available in WHM and needs to be installed.
For installing Softaculous, we need to install it via remote access. If you are using a Linux based Operating System, then you can run the installation commands directly on your terminal. However, users who use Windows Operating System need to use an emulator. Therefore, to install WordPress you need to:
- Installing an emulator (Windows)/ Open terminal (Linux)
- Installing Softaculous on WHM via emulator/terminal
- Installing WordPress using Softaculous
For the benefit of Windows Operating System users, we have listed the below steps to install an emulator called Putty. Putty is an open-source terminal and network file transfer application for Windows and can run the same commands you would run on a Linux based OS.
1. Installing Putty on your Windows machine
- Go to the official website of Putty
- Click on ‘Download Putty’
- You will be redirected to a new page, where you need to download the package based on your Windows version (32-bit or 64-bit)
- After the .exe file is downloaded, click on Run and install it by clicking on ‘Next’
- Once Putty is successfully installed, open the application like you would open any other
- In the text box ‘Host Name or IP address’ type the IP address of your Control Panel i.e the URL in ‘#Image 07’ and click on Open
- The following window opens. Here enter the password and you are ready to install Softaculous on WHM
2. Install Softaculous on WHM via emulator (Putty)
Now that we’ve successfully installed Putty and logged into our Control Panel remotely, let us now install Softaculous.
Note: If you are using Linux, type these commands in the terminal directly after logging into cPanel.
- After logging into your control panel, type in the following command to fetch the installation files of Softaculous < wget -N http://files.softaculous.com/install.sh>
- After the files are fetched type in the command to change the access permission <chmod 755 install.sh>
- Now install the files by typing this command <./install.sh> and press Enter
- After the previous step, it will take a few minutes to install all the scripts. Wait till you get the message ‘Congratulations, Softaculous was installed successfully’ on the terminal screen
- To check if Softaculous is installed on the control panel:
- Log In to WHM
- Select Plugins on the Home Page (Add-Ons on older versions than 11)
- Softaculous – Instant Installs
- The following window opens if Softaculous is installed
3. Install WordPress using Softaculous
Several scripts come pre-installed with Softaculous. Having successfully installed Softaculous, you can now install WordPress on VPS via cPanel.
- Go to the Softaculous dashboard and search ‘WordPress’. Once you find the icon (i.e the script) double click on it, this opens a new window
- Here, on the ‘Install’ tab enter the necessary details viz. the domain name you want to install the software on, protocol, language, etc. and click on the ‘Install’ button at the bottom of the page
- Once your software is installed, you would get the following message as seen in the image below on your screen. You can now customize your WordPress site as per your needs
This was one way to set up WordPress on VPS, using the control panel. Let us now look at the manual way to install WordPress on VPS server if you don’t have a control panel.
- Installing WordPress Manually Without a Control Panel
WordPress can be installed on your VPS in 4 simple steps and although this process is simple, it requires a technical background. So here we go:
- Create a Database and a User
We would once again be using either the Putty (if Windows) or Terminal if using Linux OS to access the hosting server via SSH.
- After logging into your root account type in the following commands to create a databasemysql
→ Enter the database name
create database database_name;
→ Replace your database name, username, and password in the command
grant all privileges on database_name.* to database_user@localhost identified by ‘database_user_password’;
- The image below is a representation of the commands where:wp_database == database name
wp_user == database user
Passw0rd == password of the user
WordPress can be downloaded in 2 ways viz:
- Upload the WordPress contents to your server via FTP or
- Directly download the files on the server via SSH
We would be downloading WordPress viz the second method, using SSH.
Step 1: Go to the website root directory of your domain
For understanding purpose, let us consider your directory is /home/demobigo/public_html
Type the following command: cd /home/demobigo/public_html
Step 2: To download WordPress to your server, type in the following commands
Fetch the file: wget http://wordpress.org/latest.tar.gz
Extract: tar -xzf latest.tar.gz
Step 3: WordPress will be extracted in a folder called WordPress inside /home/demobigo/public_html
i.e /home/demobigo/public_html/ WordPress
You can install WordPress on the main domain you purchased (rosetintedglasses.com) or even in a sub-directory (rosetintedglasses.com/blog). If you want to install it on the main domain then move the files by running the following commands:
→ cd /home/demobigo/public_html/WordPress
→ mv ./* /home/demobigo/public_html/
where cd == change directory and mv == move
Note: If you’d like it on a sub-directory eg: blog, just create a folder named blog and move the files to it.
To edit the configuration file you can either create and edit the wp-config.php file manually, or let WordPress do the configuration itself when you run the installation script.If you wish to configure it yourself then run the following commands:
- Rename the file wp-config-sample.php as wp-config.phpTo do this, run this command in the directory you installed WordPress:
→ mv wp-config-sample.php wp-config.php
- Open the file wp-config.php using the editor (vi editor in Linux and vim editor in Windows)To do this, run this command in the directory where you installed WordPress:
→ # vi wp-config.php
Edit the following fields by replacing the actual database details: DB_NAME, DB_USER, DB_PASSWORD and DB_HOST as shown in the example above.
- If you have installed WordPress on the main domain, just visit: http://rosetintedglasses.com/wp-admin/install.php
- If you have installed WordPress in a folder say blog, just visit: http://rosetintedglasses.com/blog/wp-admin/install.php
- Fill the Site Title, Username, password & other fields and click Install WordPress.
Note: If WordPress is not able to identify your custom saved wp-config.php file, it will tell you to create and edit the file itself. You can just enter the database details that you’d like for the WordPress database and it will store the details in a new wp-config.php file.
With this, we come to an end of our tutorial on, ‘how to install WordPress on VPS’. Installing WordPress on VPS can seem to be complicated, however, if the steps are carried out in a simplified manner then the process is easy. Also, if you are using our Dedicated Hosting then the steps to install WordPress remain the same, as the working of VPS is similar to that of Dedicated Server.
Hope this tutorial was helpful to you. If you have any suggestions, queries or questions feel free to leave a comment below and we’ll get back to you. With this, I bid you adieu, until next time folks!