How to setup a fast, reliable and cheap web server for WordPress or many other applications quickly and easily

In today’s day and age, virtually every business needs a website but dealing with all of the technical stuff can be daunting, especially for those that aren’t technically inclined. It’s easy to get ripped off by unscrupulous freelancers and without any background knowledge it’s easy to make bad decisions. Pretty much any random shared hosting platform will work for a low traffic hobby blog but if you’re doing anything more serious than that, shared hosting won’t cut it.  You need a virtual private server (VPS or “cloud server”) or maybe even a dedicated server. Once you move beyond shared hosting you could spend anywhere between $5  to many thousands of dollars per month depending on your needs. I am not going to address the ultra high end stuff because first, I don’t know and second, if you are spending hundreds or thousands per month on servers you would be an idiot not to have an IT professional or two on your payroll. My goal is to provide you with a simple tutorial that will allow you to setup a server for $10 a month that will easily support a website that gets a couple hundred thousand hits per month as long as your traffic is relatively evenly distributed and you don’t get huge spikes in traffic (news and sports websites I’m looking in your direction).

I use Digital Ocean because, quite simply, they give you the most bang for the buck. Their setup is quick and easy, their support is excellent and they only run ultra fast SSD drives. Only if you have very high storage needs might you find a better deal elsewhere but that’s going to be on slower traditional drives.

In this tutorial I’m going to show you how to set a up a $10 per month 1 core, 1 GB RAM, 30 GB disk space Digital Ocean “Droplet” to run WordPress. Right now this means your server will run Ubuntu 14.04 with a LAMP stack but don’t be alarmed if they’ve updated this to a newer version by the time you’re reading this, whatever their current default is will be fine. You can easily substitute a different image to run something else but WordPress is probably the best choice for those that are not very technically inclined or don’t otherwise have a really good reason not to run it. There’s a reason upwards of 25% of the web is running on WordPress.

Step 1) Go to Digital Ocean and create an account.

Step 2) After you follow the instructions to confirm your account and add your payment details click on “Create Droplet”.

Digital Ocean Create Droplet Step 2

Step 2

Step 3) Enter your hostname (example:, select Size $10/mo, select the region closest to where the majority of your users are, check IPv6 and enable backups. If your site’s users are spread all over the globe, flip a coin, just don’t pick Singapore.

Digital Ocean Create Droplet Step 3

Step 3

Step 4) Click on the “applications tab” and select WordPress. Power users may wish to add their SSH keys here, if you don’t know what this means, don’t worry, just continue on to Step 5.

Digital Ocean Create Droplet Step 4

Step 4

Step 5) Click create droplet and wait approximately 60 seconds.

Digital Ocean Creating Droplet

It takes less than one minute to create a new server

Step 6) You will receive your root password via email along with your server’s IP address (you can also see your server’s IP address in your Digital Ocean control panel). Login to your new server as root. You will be forced to change your password, change it to something secure like “JkD9*3uMn$8&%” and not “Password123”.

Step 7) Create the group wheel using the ‘groupadd’ command.

groupadd wheel

Step 8) Create a user for yourself using the ‘adduser’ command.

root@www:/home/clint# adduser test
Adding user `test’ …
Adding new group `test’ (1004) …
Adding new user `test’ (1002) with group `test’ …
Creating home directory `/home/test’ …
Copying files from `/etc/skel’ …
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for test
Enter the new value, or press ENTER for the default
Full Name []: Test User
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n] Y

Step 9) Add your user to the ‘wheel’ group and to the ‘www-data’ group (this may not be the absolutely “correct” way to do things but it will make it easier for you to edit your WordPress files later without always having to use root) using the ‘usermod’ command.

usermod -a -G wheel test
usermod -a -G www-data test

Step 10) Edit /etc/pam.d/su with nano (you will need to be root) then uncomment the line that says “auth sufficient trust”. Make sure you save your changes. This will allow all users in the ‘wheel’ group to ‘su’ to root. 

nano /etc/pam.d/su

Step 11) Switch to the user you just created by typing ‘su ‘ and then create and set the appropriate permissions for the .ssh directory using the commands below.

mkdir ~/.ssh
chmod 700 ~/.ssh

Step 12) Create a file in .ssh called ‘authorized_keys’ with your public key in it. Chmod 600 ‘authorized_keys’. If you don’t have a key pair it’s highly recommended that you create one (tutorial: Linux, OS X, Windows). If you don’t want to do this you can skip ahead to step 14 but this isn’t recommended especially if you haven’t set an ultra secure password (think “9FkN3$8!oP&%xC” not “MyPassword”).

nano ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys

Step 13) Test your new user by logging in with your SSH key and check to make sure that you can execute ‘su’ to become root.

Step 14) Disable root login via SSH and disable password login for all users via SSH if you completed step 12 and 13. Edit /etc/ssh/sshd_config to disable password authentication via SSH make sure the following exist, are uncommented and set to “no”: “PasswordAuthentication no”, “ChallengeResponseAuthentication no”, “UsePAM no”. Edit /etc/ssh/sshd_config to disable root login via SSH make sure you have set “PermitRootLogin no”.

nano /etc/ssh/ssh_config

Save your changes and then restart sshd.

/etc/init.d/sshd restart

Test to make sure you cannot login with SSH as root and that regular users cannot login with passwords if you chose to disable that also.

Step 15) Follow Digital Ocean’s final WordPress setup instructions located in /root/WORDPRESS to complete your installation.  You can also see Digital Ocean’s tutorial which is good but does not address setting up SSH keys but they do have a good suggestion about leaving /wp-admin double protected.  Comment out or remove the last line of /root/.bashrc that says ‘cat /root/WORDPRESS’ if you want to get rid of the annoying instructional message you see every time you login as root.

If you followed the instructions above you should now have a reasonably secure, reasonably powerful WordPress installation for just $10 per month. Read my followup article on optimizing your site for speed.

Happy bloggin’!

You may also like...

%d bloggers like this: