facebook youtube pinterest twitter reddit whatsapp instagram

How To Setup Classicpress/Wordpress on Ubuntu 16.04 Using VestaCP at Digital Ocean

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.

Requirement:

  • 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.

So,

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:

  1. 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.
  2. 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.
  3. 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.
Up next...

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:

  1. Click on the Classicpress referral link above, and fill in your details as shown below:

    Register DigitalOcean alt I obfuscated some fields for personal reasons ;)
  2. 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"

    Register DigitalOcean 2 You will only see the green box saying you've received free $100 when you use my referral link
  3. You will be sent a confirmation link to confirm your email address
  4. 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.

    DigitalOcean credit card details You may see a temporary authorization hold on your card, which your bank should release soon. DigitalOcean does not charge you until you start using paid services.
  5. 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: support@digitalocean.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.
  6. 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:

  1. Click on your new project and fill the fields; Name of your project, description, and purpose.Add new project alt
  2. Click on "Get Started With a Droplet"Get started with a droplet
  3. Select Ubuntu 16.04.6 x64
  4. 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.

    Don't select 40 bucks alt .

    $5 droplet $10 droplet isn't bad either if you feel 5 bucks is too cheap ;)
  5. 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).

    Data centre and more alt Please tick does boxes the red arrow is pointing to
  6. 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

    Select SSH alt Select SSH and Click on NEW SSH KEY

    Add a public ssh key alt Enter Your SSH Name Here

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:

 SSH Keys for Linux and Mac Scroll using the scrollbar!

Steps for windows are as follows:

Goto PuTTy website, and download the setup:

PuTTy setup Download the 32-bit version if you are on a 32-bit system, I am on a 64-bit system, so I would be downloading the 64-bit version

Install PuTTy on your local computer by double-clicking the putty program file,

 Putty installation wizard 1

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

Open PuTTY gen

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 generated ssh key alt

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:

Save private key

We are getting there!

Copy the Public Key and paste it in your Digitalocean account, make sure you copy everything:
Copy Public Key

Paste Public Key in DO

Click "Add SSH Key"

The last step of finalizing our droplet: Choose your name, add tags and Click "Create Droplet"

Finalize DigitalOcean You can also enable backup

You will see progress a progress bar:

Progress bar DO droplet

You see this, once the progress bar is done setting the server up:

26. Done with DO setup

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

    1. 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

      27. Open PuTTy Open Putty.exe ↑

       

      28. Putty opened Putty window ↑
    2. Copy The Droplets IP: Copy your droplet IP address in the control panel, and paste it in the putty IP field:

      29. Copy Droplet IP Copy droplet IP in Digitalocean control panel ↑

      30. Paste Droplet Ip to Putty Paste it in the field Hostname ↑
    3. Add SSH Key: Add the private ssh key we generated in putty

      31. Add the ssh authentication Add ssh authentication ↑

      32. Select the ssh private key Select the private key we generated from putty the other time ↑
    4. Add Root User: root is the default administration user on an ubuntu server, let's add it to the Auto-login username field

      33. Add The Root Username Type in root ↑
    5. Lastly: Save your session for recurrent login

      34. Save New Session Type in the session name, in my case, I wrote "My New Session" ↑

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.

35. Load the new session Load the new session you saved ↑

36. Confirm the server security Select Yes ↑

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:

Putty prompting for passkey of user root ↑

You can see we are connected to the 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:

39. Domain Manager Namecheap

Add Digitalocean nameserver:

40. Custom DNS Namecheap This should be ns1.digitalocean.com, ns2.digitalocean.com, and ns3.digitalocean.com

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)

41. Add a domain Click on Add a domain

42. add the domain name in the field and click create domain enter your domain in the Enter domain name field, select your droplet and click Add Domain

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:

43. Listed Domain Name

Navigate into the websitename.com, and add a CNAME record pointing www.websitename.com to websitename.com:

44. cname www. to domain.com

If everything is done properly, you should have the below DNS records:

45. Last 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:

46. Vestacp first prompt

You will be asked to enter your email address, please enter one:

47. Vestacp 2nd prompt_email

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:

48. Vestacp 3rd prompt_fqdnl

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:

49. Info to login the vestacp

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 157.245.94.17: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:
50. SSL warning when connecting to new vestaSetting Up Your Vestacp

Log in with the user and pass Vesta generated for you:

51. Login to vesta using the given admin and pass

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:

52. Hover the vestacp 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:

53. Change the Nameserver to DO's own

Press Save when you are done fiddling with the settings, take your time!

When you are done saving, Navigate to the Web Section:

54. Navigate to web section in vestacp

You should see this:

55. Vestacp web section

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!

56. Apache Ubuntu Default Page

You can read those later, head back to the web section in Vestacp and click on add web domain name:

Adding New Domain

57. Web section ADD DOMAINt

Add your domain name and change the IP address to the IP address of your droplet like so:

59. Adding domain name_1

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
  • Save.

 

60. Vestacp Advance section in web

 

Access your website URL (e.g yourdomain.com) and you should see something similar:

61. empty domain vestacp

 

Adding A New Email Account

Go to the mail section and hover over the domain you would want to add the email support for:

62. Add mail account for domain name

Add your username in the Account field, add a unique password and click on the advanced section

62. Mail account vestacp simple field

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

63. Advance section vesta mail

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

64. Softaculous free trial

Give it about 5 minutes to process, and log in to your panel.

Click on App at the upper section:

65. Accessing softacoulous in vestacp

 

Search for ClassicPress:

66. Search for classicpress in softacoulous

You should see the Classicpress page, hover over the Install and choose Custom Install:

67. Use custom install for cp

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

 

68. Classicpress Custom install setting

When you are done installing, you would be given info details, which should look something like this:

69. Classicpress installation detail in softaculous

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.

Related Post(s)

  • Send Mail with Attachment Using Mutt in GNU/Linux

    Mutt is a powerful text-based mail client for Unix/Linux operating systems. It features color support, message threading, MIME support...

  • Using Pageant To Automatically Authenticate SSH key in Putty

    I can't count how many times I have typed my ssh key passphrase whenever my ssh connection times out, it is so annoying and repetitive. Well, thanks to the putty pageant, you can do that seamlessly.

  • How To Send Mail To Multiple Addresses Using (mailx)

    In this guide, you'll learn a couple of ways you can send mail to multiple addresses using mailx. mailx is a utility program for sending and receiving mail. I assume you already have mailx command, i

  • Monitoring Multiple Log Files In RealTime With MultiTail (Ubuntu)

    Oh my... I really find scanning through the logs file time consuming, and painful. Luckily for me, I founded Multitail, which is an awesome, and powerful tool for not only browsing through several f

  • Test Your Internet Download Speed from Terminal Using (Fast)

    Fast is a tiny utility program for testing your internet download speed from the terminal, to get started, you simply install via the snap store (Ubuntu): sudo snap install fast If you don't have sna

  • Access A Web Page In GNU/Linux Using (Links) [Web Browser in Text Mode]

    Links is a text-mode World Wide Web (WWW) browses that can be used to view a web page either via a local (file://) or remote ((http:// or ftp://) URLs. To get started with Links, install it using the