In this guide, you will learn how to set up, install, and configure ClassicPress or Wordpress on an unmanaged web server at Digital Ocean VPS.
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.
- Your time and a
- Cup of water.
Let's go steadily and consistently...
To start with,
What is Classicpress
ClassicPress is a non-bloated fork of Wordpress, it was forked when Wordpress introduced the Gutenberg block editor. Also, It is baked by the communities of users in response to their needs, which is done via a petition system.
You can learn more about Classicpress
Note: If you strictly want to install WordPress, you can still follow up with the guide, the steps applies to Wordpress.
With that out of the way, there are still some nugget to clear before we jump in fully, which is
An Unmanaged Server
As the name explains, an unmanaged server is managed by you, it is not automatically controlled or managed by anyone, just by you. The hosting provider gives you access to a dedicated server where you install the necessary components to keep your server & website running, and on top of that, you won't get a support mechanism that could guide you if anything goes wrong.
You either, hire skilled people to help you with the configuration or you go with a manual installation guide, get ready to mess things up if you aren't skilled enough.
For a moment, let's assume you have a knowledge of setting up servers, you got your website running successfully, and fortunately for you, your business/website start gaining traction, to put it in another perspective, your business starts to grow, but you notice a resource hog, your dedicated unmanaged server isn't capable of serving your website anymore. You are not lost, you have three options:
- You add more resources to the existing server, which depends on your hosting provider. Some hosting provider allows for an upgrade while others do not. If you are lucky and your providers support an upgrade, then you can add more, which has limits and depending on how it is set up, you might experience downtime.
- You add more servers and distribute them accordingly, it can be a daunting task, as you have to manually configure them yourself, or again, you hire knowledgable people to do it for you.
- The last option is to migrate to a cloud server which helps you to automatically scale if the needs arise (e.g, you can automatically upgrade CPU, Ram, Disk Space with little to no downtime), which is what we would be using in this guide, which begs the question:
What is a DigitalOcean VPS?
DigitalOcean is a cloud hosting provider that offers, among others, a droplet which is their name for Virtual Private Servers. It 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 be able to configure the VPS to your liking.
The good thing about this is that, you aren't maintaining your hardware, it is done by your hosting provider, and on top of that, you can automatically scale when the need arises.
If you feel like learning more about DigitalOcean, I created an article on that: What is Digital Ocean and What Are Droplets Used For [Simple Guide!]
With that cleared, we are ready to move into the main meat of this guide, who doesn't love meat anyway ;).
Note: I'll assume you have a registered domain name
Let's buy a server at DigitalOcean and get on to setting up Classicpress.
Registering at DigitalOcean
If you have a registered domain, then you would want to point the domain name to your droplet, you remember I said, a droplet is a name for Virtual Private Server.
You need to purchase a droplet 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 DigitalOcean
Step by Step Instruction:
- Click on the Classicpress referral link above, and fill in your details as shown below:
- Sometimes, you might be redirected to a Recaptcha page upon clicking the "Create Your Account" button, verify you are not a robot, and you would be redirected to the below image, and click "Create Account"
- You will be sent a confirmation link to confirm your email address
- Once you've verified your email address, you will need to set up your billing account, this is necessary in order to eliminate frauds and spammers. Fill in your credit card details or use PayPal to make the process faster.
- Don't be surprised if your account is automatically locked after verifying your payment details, don't be scared, you will be unlocked after the team checks it manually, this should take a few hours though. If you don't want to wait, contact them using this email address: email@example.com.
Tips: In case you are asked the reason for choosing DigitalOcean, reply by saying: I want a better cloud hosting with a greater uptime for my website.
- Hopefully, your account is unlocked, and you are another step ahead.
We've covered pretty a lot already, this is where the information you learn above would merge together like ice-blocks ;)
Creating a Droplet on DigitalOcean/Creating an SSH
Droplet is the nickname of VPS (Virtual Private Server), they are virtual machines that run on top of a virtualized hardware, virtual machines are copies of a real server in that you are provided with a set amount of CPU, SSD (Solid State Disk) Storage, and RAM.
You can read more about digitalocean droplets
Let's create our first droplet:
- Click on your new project and fill the fields; Name of your project, description, and purpose.
- Click on "Get Started With a Droplet"
- Select Ubuntu 16.04.6 x64
- Wait! Don't select the 40 bucks droplet, you don't need it if you are just starting out, the $5 droplet can handle more than what you think, select the 40 bucks droplet if you know what you are doing. If you use the ClassicPress referral link, the $40 droplet would cover you for two months, which is $80, then you pay $40 every following month. To me, the $5 droplet is okay for now.
- Select your datacenter region (where you want your data hosted, e.g if your users are based in New York, select it, if you don't have an idea, kindly ignore and select at random).
- Please Select SSH as your authentication. 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. Let's proceed
We would come back to the above steps, some stuff would get complicated along the way, so, let me briefly explain a concept of how SSH works:
You remember I said SSH helps to communicate remotely with another computer. There are two pairs of ssh keys: Private and Public, 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 droplet).
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 Public key
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 follow the on-screen instruction here:
Steps for windows are as follows:
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 your Digitalocean account, make sure you copy everything:
Click "Add SSH Key"
The last step of finalizing our droplet: Choose your name, add tags and Click "Create Droplet"
You will see progress a progress bar:
You see this, once the progress bar is done setting the server up:
The next part is initial server configuration and a basic server security enhancement, it would help in securing your server a bit, when we are done with that, we can go ahead to point our domain name to our Digitalocean IP, and we finally install VestaCP.
Connect to your Droplet 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 Droplets IP: Copy your droplet IP address in the control 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:
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 I already wrote a detailed tutorial on how to do this: 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.
Pointing DigitalOcean Nameservers to Your Domain Name
I am using Namecheap, so, the control panel would be different, but it should be similar regardless of the panel.
Go into domain manager:
Add Digitalocean nameserver:
Now, head back to Digitalocean control panel, create 2 new domain name, one should be your real domain name (e.g websitename.com) and the other should be your panel name (e.g panel1.websitename.com)
Repeat the above step and create a new domain for your control panel URL: panel1.websitename.com
Where websitename should be the name of your domain
If you've done that, you should now have this:
Navigate into the websitename.com, and add a CNAME record pointing www.websitename.com to websitename.com:
If everything is done properly, you should have the below DNS records:
websitename.com should be your domain name, this is just for an illustration.
Installing Vesta Control Panel
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
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
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 and paste 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 droplet IP to login instead, e.g 220.127.116.11: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.digitalocean.com & ns2.digitalocean.com:
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 one droplet, just point your new domains to the default digital ocean nameservers at your domain registrar (ns1.digitalocean.com, ns2.digitalocean.com, and ns3.digitalocean.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 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, 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 or use wp-cli to download and install cp 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:
Search for ClassicPress:
You should see the Classicpress page, 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 pane, 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 ClassicPress.
I hope you enjoy the guide, this is like a journal on did the setup, if you are confused or some sections aren't clear, please never hesitate to ask. You can also message me privately on Classicpress Slack @Horlaes I would be happy to help you out if I can.
Credit: Thanks to Wade Striebel & William Patton for pointing out errors, and demystifying complex terminologies.
Props to the hard-working dude at Classicpress, Wade, James, Tim Hughes & Tim Kaye, Klein, Lan, John, Alan, Earle, Elisabetta, Fabian, Michelle and others I didn't mention.