In this guide, you will learn how to set up, install, and configure ClassicPress or Wordpress on an unmanaged web server using Upcloud VPS (Virtual Private Server).
The server we are going to set up would be running on Ubuntu 16.04 with a working Vesta Control Panel that can be used to manage multiple websites, email accounts, Ftp accounts, Mysql Databases, DNS records, and more.
We would also cover the security aspect of your server, this way, you can ensure everything stays secure from intruders.
Let's dive in...
What is an Upcloud VPS
Upcloud is a cloud hosting provider that offers a Virtual Private Server, which acts like a dedicated server in that, you own your virtual server, you are also giving the privilege of choosing your OS during deployment, and you'll also be able to configure the VPS to your taste.
The good thing about using a VPS is that you aren't maintaining the hardware, although you are the one managing the Operating System, but it defers in the sense that you are able to scale when the needs arise, say you need more Ram/Storage/Additional Cores with little to no downtime, you are given an option to easily do that, unlike a dedicated server where you do things manually.
With that cleared, we are ready to move into the meaty section of this guide, so, let's proceed.
Note: I'll assume you have a registered domain name
Let's buy a VPS at Upcloud and get on to setting up Wordpress or ClassicPress.
Registering and Buying a Vps at Upcloud
If you have a registered domain, then you would want to point the domain name to your server.
You need to purchase a VPS to proceed.
*Cough*: Get free $25 when you use my referral link, this way, you not only enjoy free credit but you also help in supporting Devsrealm infrastructure.
This is a no referral link: Register Upcloud Vps
Step by Step Instruction:
- Click on the signup link above, and fill in your details as shown below:
- You should see a green box saying you've received $25 in free credits when you use my referral link, Fill in your user information and set up your billing account, and note that upcloud would make a tiny charge of $1 and immediately refund it to verify your credit card.
- Once you've signed up, your account would be in trial mode which would be available for 7 days, you can remove the restriction by making a one-time deposit of $10 with a 30 days money-back guarantee.
That is pretty much it about creating an account, let's deploy a server.
Deploying a Server at Upcloud and Securing With an SSH
To create a new server, you goto...
- Your dashboard by visiting Upcloud Hub and you click on the Deploy Server Button
- The next step is to configure your VPS (Image Below)
Location - Select your datacenter region (where you want your data hosted, e.g if your users are based in Germany, select it. My users are based in the USA, so, I will be choosing US-SJO1(San José) if you don't have an idea, kindly ignore and select at random).
Plan - You can start with the $5 plan, this can handle more than you think when combined with a caching. If you want to play safe, you can also go with the $10 plan.
Storage - This greatly depends on the size of media you would be storing, but 25GB should be more than enough if you aren't hosting say mp3 or video files, and if you feel that isn't enough you can add more using the Add a New Device, then you use the slider to select your preferred storage size.
Again, 25Gb should serve you for a long period of time if you aren't hosting larger media files, well, this is a VPS, you could always add more at a later time if you feel you need more.
Note: If you are planning to host multiple website on one server, you can add more storage right from the bat, this way, you would be able to spread out enough storage volume.
Operating system - Select Ubuntu and use the drop-down icon to change the version to Ubuntu Server 16.04 LTS (Xenial Xerus).
- Tick IPV6 Support
- Allowed login methods - Choose Only SSH.
Secure Shell is more secure than using a password to login to your server. SSH helps to communicate remotely with another computer, this method of authenticity ensures the exchange of data is encrypted. This way it can't be intercepted by any unauthorized system. There is more to this, but for now, just see SSH as been stronger when compared to Password authentication.
Leave the rest of the options in the Optionals section as default.
You can also change the Hostname to your preferred name, in my case I had "ubuntu-WordPress" as my hostname, and I also wrote the description of what I am gonna be doing with the server.
Do not click Deploy, let's add our SSH key.
Before we generate our SSH key, let me quickly explain the concept of SSH.
There are two pairs of ssh keys: The Private and Public Key.
The private is known as the client key (those are the ones in your physical or local computer), the public key is stored in your server (in this case, your upcloud VPS).
When the client tries to connect to the server, the client does this to the server:
- Client: Hey server, I am your boss, I have the private keys
- Server: hmm, where is your signature if you are my boss
- Client: .......... (note: the client isn't sending the private keys, it demonstrate to the server that he is the owner of the private key, in the form of a digital signature)
- Server: Let me verify from the Public key (the one in your Upcloud VPS)
The server verifies the signature and if it correlates, the client is given access to the server.
We need a way to generate the Private and Public Keys, on windows we use a program called PuTTY, on Mac and GNU/Linux, you use Openssh.
I am on Windows, so, I would be using PuTTy. Mac and GNU/Linux users can use the command line, I will also show you how you can do this.
Goto PuTTy website, and download the setup:
Install PuTTy on your local computer by double-clicking the putty program file,
Upon clicking on Next in the above image, click on the subsequent Next and wait for PuTTY to complete the installation.
Once that is done, search for PuTTYgen or locate it inside this folder:
C:\Program Files\PuTTYand open puttygen.exe
Go to this folder on a 32-bit system:
C:\Program Files (x86)\PuTTY
Click Generate and move your mouse randomly over the blank area. This is called the entropy of mouse motion, bring in thousands of users, and no one would ever predict your mouse movement, this means no one can reproduce your keys. If you are curious you can read this StackExchange answer .
Your key looks like this, once it is generated:
The good thing is that you can also password protect your ssh key, by filling the Key passphrase field, this way, when someone gains access to your computer, they will need to provide a passphrase to access it and on top of that, you must provide this passphrase every time you use this key.
Note: Don't use a simple password or password you've used elsewhere, use something stronger, you can generate one here: Password generator
Once generated, store the password inside a private book at home, No, don't keep it on your PC.
Save your Private Keys in a folder in your local computer:
We are getting there!
Copy the Public Key and paste it in the Upcloud SSH Key field, make sure you copy everything:
When you paste the SSH Key, it would automatically fill the name for you, but feel free to change it to whatever name you like, when you are done Click Save the SSH key.
For GNU/Linux & macOS:
Open terminal (on macOS goto Applications -> Utilities -> Terminal) and run the following command:
You will be prompted to enter a file in which to save, Leave this to empty by pressing the enter key, this would create the key in the default location, which is /home/user/.ssh/id_rsa
this would create both the public key and the private key in that same location, note that, the user in /home/user would be your username, for example:
Next, you will be asked to create and confirm a passphrase for the key, you can skip by hitting the enter key but this is highly recommended to secure your SSH key even more.
Once you are done entering and confirming the password, this would generate two files, by default called id_rsa and id_rsa.pub.
The .pub is the public key that would be copied into the SSH Key field
Let's copy the public key, use the following command:
then you just copy the key :
You can see where I started from "ssh-rsa" and don't copy the user@hostname, in my case I have thisisme@devsrealm, this is a comment, so we don't need it.
Add the key and save.
Lastly, Deploy your server:
You should see the new server in your hub when you've successfully deployed it:
The next part is connecting it to our server, a basic server security enhancement, pointing our domain name to Upcloud VPS IP, and we finally install VestaCP.
To connect to our server, we use Putty on Windows and the terminal on macOS & GNU/Linux.
Connecting to your VPS with PuTTY on Windows
Since we have PuTTy installed, let's configure it to connect to our DigitalOcean Droplet
- Open PuTTy: Locate it inside this folder: C:\Program Files\PuTTY and open putty.exe, if you are on a 32-bit system, goto this folder C:\Program Files (x86)\PuTTY and open putty.exe
- Copy The Server IP: Copy your server IP address in the hub panel, and paste it in the putty IP field:
- Add SSH Key: Add the private ssh key we generated in putty
- Add Root User: root is the default administration user on an ubuntu server, let's add it to the Auto-login username field
- Lastly: Save your session for recurrent login
- Open PuTTy: Locate it inside this folder: C:\Program Files\PuTTY and open putty.exe, if you are on a 32-bit system, goto this folder C:\Program Files (x86)\PuTTY and open putty.exe
Once you are done with the above steps, you can open up putty and select your new session to access your server.
Note: The first time you connect to the Droplet, PuTTY security alert would pop-up asking you to confirm that you trust the server. Please choose yes to save the server host key as this is the first time you are connecting or No to connect without saving the identity.
Putty would automatically add your root username, and since we are using an SSH key, you would be prompted for the password you set on your key, input the password and you should be automatically connected to your droplet server:
How to Connect to your Server with OpenSSH on macOS & GNU/Linux
- Open Terminal (on macOS goto Applications -> Utilities -> Terminal). Press CTRL + ATL + T if you are on GNU/Linux
- Once the terminal is open, log in using the following command (substitute the IP to your server IP address)
- The first time you log in, the server doesn't have a cached key on the local machine, so you'll be asked if you're sure you want to continue connecting. Type yes and then press ENTER.
- The Hostkey would be added to your local machine
- Since you have added the ssh key in your upcloud server, you would be prompted to enter your ssh key password, type the password, press the enter key, and you would be connected to your server
Initial Server Setup In Ubuntu (Recommended)
I almost skipped this part!
This section is highly recommended if you care about tightening your server security, the usability and also the reliability of the server.
I won't cover this as this is already covered extensively in this tutorial: Initial Server Setup on Ubuntu 16.04 [Enhancing Server Security]
If you prefer an automatic method, you can use a setup script from Jason Hee, It does the heavy lifting for you.
Honestly, you should go with the manual method, you will not only learn how to troubleshoot issues in the future but also see what is going on step by step, it is up to you.
How to Set up Host Records for Your Domain
To add DNS records, follow this guide from Upcloud: Domain Name System and how to manage DNS records If it is not clear, I would be happy to assist you.
Having done that, let's install VestaCP.
First off, log in to your non-root user account, if you don't have a non-root user, follow this guide Initial Server Setup on Ubuntu 16.04 [Enhancing Server Security]
Download bash install script using the following command:
sudo curl -O http://vestacp.com/pub/vst-install.sh
You might be prompted for a password to confirm you are the new user, enter the password for the non-root user and proceed by removing group admin using:
sudo groupdel admin
If you receive admin not exist, please ignore and proceed.
Finally, use this to install vesta:
sudo bash vst-install.sh
You would be asked to confirm the software you want to install on your system, enter y and hit enter:
You will be asked to enter your email address, please enter one:
Lastly, you will be asked to enter your FQDN (Fully Qualified Domain Name), this should be the panel URL: mine is panel1.devsrealm.com
If you don't have a sub-domain, create one from your domain registrar dashboard, if you aren't getting, drop your comment and I would assist you ;)
Note: Devsrealm is the name of my domain, so you should replace it with yours:
Vestacp would take about 15 minutes to complete the setup, sit back, and watch.
Once that is done, Vesta would give us the info to access our control panel:
Copy the panel address and paste it in your preferred browser, this is mine: https://panel1.devsrealm.com:8083
Note: If you aren't able to access your panel URL, it probably has to do with the DNS propagation, it might take anywhere between 30 minutes - 48 hours, use your upcloud server IP to login to access it for now, e.g 188.8.131.52:8083 , you can also check the url using whatsmydns.net to see if your url has propagated.
You will get an SSL warning like this, kindly click on advance and proceed, the warning is normal for first-time access:
Setting Up Your Vestacp
Log in with the user and pass Vesta generated for you:
Don't be like the average joe, the first thing you should do is changing your Vestacp password.
Hover the admin area, and click Edit:
You can either let Vesta generates the password for you, or you generate it yourself using Password generator
Wait! Don't save the settings yet, You can also change other settings, for example, the user's first and last name, the most important part is the Nameserver:
Change both fields to ns1.yourdomainregistra.com & ns1.yourdomainregistra.com (this would be the default DNS from your domain registrar:
Press Save when you are done fiddling with the settings, take your time!
When you are done saving, Navigate to the Web Section:
You should see this:
Before we go on editing, visit the URL to confirm all is in place (if the URL isn't working, then it is likely the domain name hasn't propagated, simply visit your server IP to proceed), if all done well, you should see an Apache Ubuntu Default Page, telling you it works!
You can read those later, head back to the web section in Vestacp and click on add web domain name:
Adding New Domain
Add your domain name and change the IP address to the IP address of your droplet like so:
Click Advanced Options, and use the following setting:
- Aliases should be www.yourdomainname.com, this way your user can access your website using www
- Web Template - Default
- Proxy Support - check
- SSL Support - check
- Let's Encrypt Support - check
- Web statistics - choose Awstats, I love how it shows me the bandwidth I am consuming
- Statistics authorization - check, and add a unique user & pass
- Additional FTP - If you feel you need one for uploading to your hosting easily, check and create the user and pass, leave the path as is
Access your website URL (e.g yourdomain.com) and you should see something similar:
Adding A New Email Account
Go to the mail section and hover over the domain you would want to add the email support for:
Add your username in the Account field, add a unique password and click on the advanced section
The Quote allows you to set a mailbox size limit. This is useful since you would want to reserve disk space for other things. You can press the infinity icon to give it an unlimited storage
Aliases allow you to add other email addresses that forward to that main account, you don't need this in most cases. The only case you might need is when you have an email account on another service, and you want to keep your emails on that service.
Send login credential to and available email of yours and click Add
To access your email, use panel.example.com/webmail, where example.com should be your domain name, log in with the user and pass you just setup, and you should be ready to go.
Note: You can also use branded nameservers if you have one, it makes it possible to brand your nameserver, say you want to use a custom nameserver for every website you are using e.g (ns1.yourwebsite.com), this is beyond the scope of this guide, but if you want to host multiple websites on a single upcloud server, just point your new domains to the default registrar nameservers at your domain registrar panel(ns1.yourregistra.com, and ns1.yourregistra.com) and add new domain as we've done above, and lastly, when adding new domains, make sure you select public address from the listed IP addresses.
Installing WordPress or ClassicPress Via Softaculous
Softaculous come pre-installed in Vestacp. It is useful for installing scripts among others are Classicpress, Presta, Joomla, Abantecart, and Wordpress.
Unfortunately, WordPress or ClassicPress isn't available in the free version of softaculous, but there are workarounds, we can either use a free "softaculous one-month trial license" to install Classicpress/WordPress or use wp-cli to download and install cp/wp which is beyond this guide, a tutorial would be available for that very soon, for now, let's use the free month trial.
Note: You can also buy a VPS license for $12 a year, the price is reasonable
That said, visit Softaculous Free Premium for the free trial, enter your droplet IP and click issue license
Give it about 5 minutes to process, and log in to your panel.
Click on App at the upper section:
WordPress should be the first script listed, click on it and follow the next step
As for ClassicPress, you search for it in softaculous, and the rest of the below steps applies to either of CP/WP.
Hover over the Install and choose Custom Install:
Use this setting to complete the installation:
- Software Setup - Choose your domain name, and make sure the In Directory is blank
- Site Settings - Add the website name and your preferred description
- Admin Account - You need this to access your admin panel, input user, pass and email of the account
- Enter your email in the Email installation details, and Install
When you are done installing, you would be given info details, which should look something like this:
Access the admin dashboard(e.g https://yourwebsite.com/wp-admin) and go rocking with WordPress.
I hope you enjoy the guide, if you are confused or some sections aren't clear, please never hesitate to ask.