Host Your Own Series: Step One – Get A Server

Cloud Banner

There’s a lot of people who are concerned about the current privacy issues going around the Internet, with the revelations of the NSA and PRISM. That’s sparked a lot of people to question their allegiances to many online companies, and the data they have with them.

The only way to ensure that your data is safe, if to take control of it. So, in this series, we will be showing you how you can set up and manage your own alternatives to common tools like Gmail, Dropbox, Google Reader/Feedly, Google Calendar, and many more. First things first though, we need a server to host it all on…

Finding The Right Host

There’s a tonne of hosts out there, all offering varying servers, power, packages, and features. So what’s the best to get? Well, I’ve got a lot of experience in this field, and personally, I’ve settled on Digital Ocean. This isn’t an affiliate link, I just think they offer the best value for money, support, and service out there. A close second would be Linode, but they’re a little more expensive.

Both of these companies offer self-managed Virtual Private Servers (VPS), Digital Ocean start at just $5 per month for a VPS with 512MB RAM, 20GB SSD storage and 1TB of monthly transfer. I would recommend going for this package, you can always upgrade if you feel that this isn’t powerful enough for your needs (more on that later).

Digital-Ocean-Plans

Why Do I Need A VPS?

The truth is, that a cheaper shared host just wont cut it here. With a VPS, you get more power, and a lot more freedom to do what you want with the server. You are basically renting a full server from your chosen company, so you will have full root access to do what you like. You don’t get this type of freedom with shared hosting, and the terms & conditions on the accounts are usually quite restrictive.

Ok, now we have all that out of the way, let’s take a look at setting up your VPS…

Setting Up Your New VPS

I’m going to assume that you have gone with Digital Ocean, this will be the example I use throughout this series, as it’s what I use. We will set our server up with Ubuntu 12.04 x64, again, you can use what you like, but it’s what I’m most comfortable with, and it’s what I will be using for all examples throughout this series.

Once you have signed up for a Digital Ocean account, log in and click on the big blue button that says Create Droplet. A “Droplet” is what Digital Ocean calls a VPS. You will now see the options to configure your server, these are listed below:

  • Hostname: This is the name of your server, it can be anything you like. Some people like to have a naming convention for their servers, for example, mountain names – Everest, Snowdon, etc. But you can just as easily have server01. It’s completely up to you. Personally, my servers are called “lucid” and “ghost”.
  • Size: This is the size of your VPS, prices can be found here. I would recommend starting with a 512MB box, as this can always be increased at a later date.
  • Region: This is the geographical location of the data centre where your VPS will be located. It doesn’t really matter where you choose. I’d recommend choosing whichever location is closest to you geographically.
  • Image: Here you can select which operating system to install on your VPS. If you want to follow along with this series, then I’d recommend selecting Ubuntu 12.04 x64 (not x32).

 

Once you’re ready, click the create Droplet button, and the system will automatically create your server for you. Once ready, it will send you an email with the log on details for your new server. Here’s where the techie fun stuff begins!

Install A Control Panel

A control panel is a simple way for you to manage your web server from a browser window. It will allow you to do things like install web applications, setup email addresses, upload files, and manage databases. We’re going to be using ZPanel for this, because it’s free, easy to use, and works really well.

The guys over at ZPanel already have some documentation for this, which can be found here. But, to keep everything in one place, I’ll show you how to do it as well. The first step is to log on to your server via SSH, you can use free applications like Putty to do this. Once you’re connected to your server, simply run the following commands:

  • wget https://github.com/bobsta63/zpanelx/releases/download/10.1.0/installer-10-1-0-ubuntu-64.sh.x
  • chmod +x installer-10-1-0-ubuntu-64.sh.x
  • apt-get install curl at
  • ./installer-10-1-0-ubuntu-64.sh.x

 

During installation, you will be asked to enter the hostname for your ZPanel installation. You will need to have a domain name, then create a sub-domain that points to the IP address of your server. For example, I have lucid.kevq.me set up for mine.

Once the installation as finished, it will display a box with extremely useful information in like usernames and passwords. THIS INFORMATION IS EXTREMELY IMPORTANT, so make sure you save it to a safe place, as you will need it to log on. You should now be able to go to the web address you entered during installation, and log in to your control panel.

ZPanel-Home

From here you can setup any domains that you own, as well as FTP accounts so that you can upload files to your server. Have a play around and familiarise yourself with ZPanel. It’s extremely easy to use, but if you get stuck, there is always the community forums who are very friendly, and always happy to help.

Backing Up Your Server

Digital Ocean have a back up service that you can turn on. For the 512MB VPS, it’s just $1 a month, this cost then doubles with every incremented server size. So a 1GB is $2, 2GB is $4 etc. This automatically backs up your server every day. For such a small cost, I would highly recommend turning this on.

You can do this by logging in to your Digital Ocean account, selecting your Droplet from the list, then clicking on the Backups tab. Simply click on the blue button to enable backups, and that’s it.

Set Up Monitoring On Your Server

You’re going to be responsible for this server yourself, so it’s a good idea to set up some monitoring on the server so that you can see what’s happening with it. This will also allow you to pro-actively increase the size of your sever if you need to. For this we’re going to be using a free New Relic account, which will monitor your CPU, RAM, network throughput, server load, and disk space. This should be enough to keep an eye on your server. Here’s a look at my New Relic dashboard:

New-Relic-Dashboard

Setting up New Relic monitoring will require a little bit of command line work again. So, sign up for a new account, and log in. Once you’re in, click on the green Add more button towards the top of the screen. Then, click on the red Instructions button next to Ubuntu or Debian.

This will display step-by-step instructions for installing the New Relic monitor on your server. So, connect to your server via SSH again, and enter the commands displayed on-screen. Once it’s done, you should start seeing your server statistics piping in to New Relic after a few minutes. On a free account, you can only check the last 24 hours of server stats, but I personally find that this is enough as I check it quite a lot.

Increasing The Size Of Your VPS

The likelihood is that your VPS will run out of RAM before it runs out of anything else. So, you may need to increase the size of your Digital Ocean VPS. To do this, you need to first of all shut down your server via SSH using the command shutdown -H 0. Then log in to your Digital Ocean control panel, and select your Droplet.

Once in, click on the resize tab and select the new size of your server. This process only takes a round a minute, once it’s done, re-boot your server using the big blue boot button within the Digital Ocean control panel. After a few minutes, you should see the increased specs within New Relic.

Conclusion

That’s it, you now have your very own VPS, that’s all set up and ready to go. In the next article in this series, we will look at the basics, which is adding a domain to your server, and starting to replace services like Gmail. In the meantime, feel free to explore your new server, play around, and familiarise yourself with it. I find that working things out for myself if the best way to learn.

Having problems, or have questions? Just leave a comment below and we will be happy to help.

Host Your Own Series: Step One – Get A Server
User Rating: 3.5 (5 votes)