Setting up WordPress on a Virtual Private Server (VPS) is easier than ever with simple one-click solutions. There is no reason to use a shared hosting solution. Simply put, a VPS is more secure and you can scale up your resources as your blog grows. It will only cost you about $20 a month to start.
Here is what you will need if you plan to setup WordPress on a VPS
13 Steps to Setup WordPress on a VPS
We are going to use PuTTYgen to create a key pair. We will use this to secure our server.
You’ll want to copy your public key file.
I am on a mac. So I used my terminal to cd into the folder holding my key files.
I then use the command “ls” to view all files in the folder
Then I used the command “vim ida_rsa.pub” to see my public key.
Then I copied and pasted that key somewhere private.
To exit vim type a colon and then x to exit.
We will need the public key for our next steps.
Sign up for an account with Digital Ocean.
Setup Two Factor Authentication.
We want to follow all the best practices while setting up our website. So make sure that your Digital Ocean account is protected.
You will find this under accounts.
Create a new droplet.
Got to the marketplace tab.
Select WordPress for one-click installation.
On the same page where you selected WordPress:
Under Plan choose standard.
Then click the left arrow to choose the $20 4GB plan.
Continuing down this screen, the next choice is the region you want your server on. I always pick the region closest to where I live.
The next thing we will do is add our key.
Under authentication choose SSH Key.
Then click New SSH key.
On this screen paste your public key and save.
The last thing we will do is name our droplet and optionally add backups.
Although it will cost you $4 for backups, I highly suggest you do this. You can roll back your website if you get the white screen of death on your WordPress. If you don’t do backups, you will have to take a snapshot of your server before mucking around in your website. Saving snapshots also cost a few cents per how many you have.
The next step is to log in to your droplet using the command line.
The command is “ssh root@ip-address”
Your ip-address is found on your list of droplets.
Mine, for example, is 184.108.40.206.
It should get connected via your key pair.
When the prompts come up just type yes.
Scroll down the command line until you see the instructions for completing your WordPress installation.
Adding your domain will complete the WordPress setup.
Answer all the following prompts.
You will see this at the end for a successful installation.
You will need to go back to the same create button you used to create your droplet.
This time choose to create DNS.
Now, you will enter your domain name and save it.
This will bring you to a new screen.
You will see three name servers that were added to your domain. You use these where your domain is registered. For example, my domains are at Namecheap. I went into the DNS settings and added my nameservers.
Now that this is done, come back to Digital Ocean.
We will complete adding our DNS information.
We will add two A records and one CNAME.
For one A Record choose host at @ and select the ip-address of your droplet. This is the apex domain.
For the second A Record choose * and select the ip-address of your droplet. This redirects all sub-domains to the apex domain.
For the CNAME choose www and the alias as @. This will redirect the www.domain.com address to domain.com.
It may take up to 48 hours for the DNS to propagate. You know it is complete when you type in your domain and you get your WordPress blog!
From there login to your WordPress by navigating to domain.com/wp-admin.
Use the username and password you entered when setting up your website in the command line.
You can use WINSCP and Cyberduck to access your website files.
Just select the SSH options and sign in using your key.
Insructions for WINSCP – Windows
How to Update Ubuntu 18.04 – Do this reguarly to get the latest patches for you server.
Or Hire Me
For $10 a month I will manage your WordPress blog.
- Backing up Database and Files
- Installing Security Plugins
- Keeping WordPress and Plugins updated
- Recovery from Hacking
- Migration to a VPS
Email if you are interested email@example.com
Featured Image Dayne Topkin