This article will go you through the process of creating a secured VPS cloud hosting on Vultr.
1. Creating a new instance
Login to your Vultr dashboard and buying/creating a new instance.
2. Adding Users
Connecting to the server by using SSH. Using the root account provided by default to connect. For example,
ssh email@example.com and enter the password provided. Then adding a new user by using the following command:
$ adduser test
After that, adding that new user, test, into the sudo group. To do that, simply run the following command:
$ gpasswd -a test sudo
3. Creating a swapfile
Swapfile enables us to increase the size of the default RAM amount provided by Vultr. It is the reserve file to help allocate when the default RAM space running out. First, paste in the following command:
$ dd if=/dev/zero of=/swapfile count=2048 bs=1M
Next, activate the swapfile by running the following command:
$ chmod 600 /swapfile
Next, tell the server to setup the swap file by running:
$ mkswap /swapfile
Then turn the swapfile on by running the following command:
$ swapon /swapfile
The last step is to enable the swapfile on reboot. First, open up the fstab file by going to
$ nano /etc/fstab
Then paste in the following command, save and quit.
/swapfile none swap sw 0 0
4. Installing Vesta Panel or Hestia Panel
First run these 2 commands respectively:
$ sudo apt-get update $ sudo apt-get dist-upgrade
Download Vesta by running the following command:
$ curl -O http://vestacp.com/pub/vst-install.sh
Or Hestia Panel:
Install Vesta by running:
sudo bash vst-install.sh
Or install Hestia by running the following command:
5. Install PHP 7 GD Library
In case you have PHP5 Installed, then most of the time, the new running site cannot process the image related actions. That is because of the PHP7 GD library is missing on Ubuntu 14.04–at the time of this writing. To install this library, simply run the following command:
$ sudo apt-get install php7.2-gd
6. Install Soap Extension for PHP 7
Some plugins may require PHP soap extension to work properly. In case the server is using PHP 7, install this extension by running the following command:
$ sudo apt-get install php7.2-soap
Then restart apache.
7. Some Other Missing Modules
For WordPress 5.2 and above, there’s a built-in tool named Site Health under the Tools => Site Health that recommends you to install the missing, might be helpful, other modules on your server.
In my case, WordPress recommends me to install bcmath and imagick modules to improve the site performance.
$ sudo apt-get install php7.2-bcmath $ sudo apt-get install php7.2-imagick
Then restart apache.
I’ve shot a video following the above step by step guides. But unfortunately the video was made in Khmer language, I’ll add English subtitle later on.
Watch the Video: