Have you ever considered hosting WordPress on a virtual private server?
Congratulations! You have got a website developed from the best web design company. It’s got all the bells and whistles to make your audience fall in love with you. Now, you have to host your website. Choosing a web hosting service provider can be tricky, especially when you consider the number of hosting providers selling similar services and making similar claims about how good their service is.
Let’s say you have somehow finalized the hosting provider. Now you will have to choose between an array of their offerings. The type of server and hosting. What configuration will be the best and which operating system would you want to run on your server?
All these questions can confuse even the most tech-savvy amongst us let alone a layman who does not know much about hosting and servers. Do not worry, HOSTNOC is here to clear all your confusion.
As the name suggests, dedicated servers give you access to dedicated computing resources. In contrast, the shared server gives you access to shared computing resources so there is a clear difference between price and performance. Dedicated servers deliver better performance but also costs more meanwhile. Shared servers cost less while delivering average performance.
What if you want a perfect middle ground between price and performance? That is where the VPS server comes into play.
A VPS takes advantage of virtualization and tries to mimic a dedicated server environment inside a shared server. VPS hosting allows you to get the best of both worlds by letting users experience the security, performance, and reliability of dedicated hosting by paying the price of shared hosting.
Let us say you are a small business with basic needs that can easily be fulfilled by shared hosting. Should you upgrade to VPS? No, you should not. VPS server is an ideal choice for growing businesses that need more power without paying extra for it. If performance is your priority and you are ready to spend more money on it, then you should go for dedicated servers.
Here is a comprehensive guide that contains all the information you need to install WordPress on the VPS server.
Even though the process might vary from hosting to hosting, you can still get a basic idea about installing WordPress on cPanel. Many WordPress VPS services enable users to install WordPress on VPS servers. One of them is Vultr. We are using it as an example in this VPS setup tutorial.
Create an account and sign in to Vultr account
Go to the server tab on your dashboard
Click on the Add New icon on the bottom right corner of your screen
Select the location of your VPS
Go to the Server Type section and go to the Application tab where you will find the WordPress option at the bottom and click on it
WordPress will be automatically installed on your VPS server
Choose a pricing plan and enable or disable extra features according to your needs
Name your VPS
Click on the Deploy Now button
Access VPS settings by clicking the Server tab
Follow the instruction on the main setting screen to complete the setup process
Finish the installation process by logging into the account through the URL provided by Vultr
There are four steps involved in installing WordPress manually on the VPS server
Connect VPS via SSH
Install Software to run WordPress
Configure Maria DB for WordPress Database
Install and Run WordPress
To run necessary commands, you should have a server root password and a secure shell client such as Putty. Install and run Putty and a window will appear, which allows you to enter the destination address you want to connect to. Type the VPS IP address in the hostname or IP address field. Set the port option to 22. Select SSH under the connection type field and click open. A command window will pop up, which will prompt the user to log in as root. Enter your password when asked. Your VPS name will be visible if you have typed the password correctly.
To run WordPress, it is important that you have the following:
Run this command to install Apache, MariaDB and PHP
udo yum install httpd mariadb mariadb-server php php-common php-mysql php-gd php-xml php-mbstring php-mcrypt php-xmlrpc unzip wget -y
This command will ask the server to download all the required files and set them up. Wait for a few moments for the process to complete. Once the process is complete, run this command.
sudo systemctl start httpd
sudo systemctl start mariadb
sudo systemctl enable httpd
sudo systemctl enable mariadb
Secure your MariaDB installation from unwanted remote access by running this command.
Next, MariaDB will ask you to enter a root password. Enter the password and hit enter. You will now be asked to set a new root password. Choose Y for other options. Enter the following command to log into the MariaDB account.
mysql -u root -p
Next, run the following commands to get your database ready.
CREATE DATABASE wordpress;
GRANT ALL PRIVILEGES on wordpress.* to ‘user’@’localhost’ identified by ‘password’;
Download the latest version of WordPress, configure and install it. Run these commands.
tar -xzvf latest.tar.gz
sudo cp -avr wordpress/* /var/www/html/
To create Upload Folder and assign permission to files and folders, run the following commands.
sudo mkdir /var/www/html/wp-content/uploads
sudo chown -R apache:apache /var/www/html/
sudo chmod -R 755 /var/www/html/
Rename and configure your wp-config sample.PHP file so it can connect with the database by using the following command
sudo mv wp-config-sample.php wp-config.php
sudo nano wp-config.php
After running the aforementioned command, a file will open inside the nano editor inside the command line. Look for the following:
Update these three fields. Once done, Press CTRL+O and CTRL+X. It will save the changes and close the nano editor. Now, you must configure the VPS to allow HTTPS connections. To do so, use the following commands.
sudo firewall-cmd –permanent –zone=public –add-service=http
sudo firewall-cmd –permanent –zone=public –add-service=https
sudo firewall-cmd –reload
Now you can access the WordPress installer by accessing your VPS by typing in the URL http://VPS IP ADDRESS.
I hope this guide might have helped you in installing WordPress on your VPS server. Which method do you follow to install WordPress on the VPS server? Let us know in the comments section below.