Jump to content


Latest Files

Recent Topics


Photo

Using DigitalOcean to Make a Personal VPN

init.d

  • Please log in to reply
5 replies to this topic
Johners
Johners

    Gone for a Cheeky Nandos

  • Member
  • 2,502 posts
  • LocationUnited Kingdom

This guide is going to show you how to setup a personal VPN using the service DigitalOcean - a high quality VPS provider that offers high-quality, SSD based, Linux servers at a great price. They have a ton of options for what you can deploy. You can have Ubuntu, Fedora, CentOS, Arch and Debian servers with a number of 32 and 64 bit releases of both. You can also deploy a number of applications such as a LAMP stack to get running straight away. However, enough of the talking about DigitalOcean and onwards with the guide we go.

 

Step 1 - Setting Up Your DigitalOcean Account

The servers on DigitalOcean are referred to as Droplets and you can have more than one of them. Depending on how much money you spend you get an increased number of Droplets you can deploy. Before we begin we need to register to DigitalOcean, you can do that here. Before you can make a Droplet you need to put some money into your account. I recommend $10 because that will allow you to use more than the lowest package and you can also do the smallest package for two months before having to put more money onto the service. Once this is done you can now create your Droplet.

 

Step 2 - Setting Up Your Droplet

The initial step of making your droplet is giving it a hostname. This can be anything you like and I personally went for the name OpenVPS.

gHiPrNs.png

 

Now we need to select a package. You should choose this carefully based off of your needs. I won't be going over 1 TB of transfer in one month so I'm going with the lowest package. The hardware on that package is powerful enough to provide a high quality service. Feel free to buy a bigger package if you must.

9rYBNkT.png

 

Now we need to select the region that the server will be available in. Note that New York 1 and Amsterdam 1 are currently unavailable due to high popularity and a high load that is constantly on these servers. However, there are four other high quality locations/servers you can put your droplet onto. This will effect the VPN so if you want to get onto US Netflix then put your droplet onto one of the servers in the USA.

4Y28NMq.png

 

Now we select the image/distribution that will be deployed onto the server. There are many options on DigitalOcean, a lot more than more other services, there is even an option to deploy a WordPress server and then all you have to do is configure it. For this tutorial we need to use Ubuntu 12.04.4 x64 for our VPN.

WhDsYTX.png

 

Now you need to smack the create droplet button and wait 60-ish seconds... You will also receive your root password via email once it is created.

D57VDcl.png

 

Step 3 - Connecting To Your New Droplet

In this stage we are going to use PuTTY to SSH into your new server in order to setup your VPN. We will also do some security things to stop those pesky hackers from potentially gaining access to your server. You can download PuTTY here. The initial step of connecting to your server is opening up PuTTY, setting the point to 22 and then putting the IP of your Droplet, sent in both the email and available on your Droplet's web control panel. Once you have done this hit connect and press 'Yes' when the message comes up.

8T74kM3.png

 

Once you get onto the black PuTTY screen you need to login. Type in root for your username and then the root password that was sent via email when you created your droplet. You should then see this screen.

OwEB2hx.png

 

For security reasons we are going to change the root password so if anybody gains access to your email they will not know what the root password for this droplet is. I'd recommend to have something long, mixed with all types of characters and something you will remember. If you want you can write it down but make sure you don't your password to anybody. To change your password type in the command passwd and then you will be prompted to enter a password and enter it again. The screen will look like this.

RmGj20x.png

 

Step 4 - A Quick Speedtest

Now we are going to do a quick Speedtest that will use the same servers that Speedtest.net uses but instead of using a flash based solution in a web browser we are going to use a command line tool that does the things for us. Type in the following commands:

wget -O speedtest-cli https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py
chmod +x speedtest-cli
./speedtest-cli

It should show a screen that looks like this...

gggInoU.png

 

Step 5 - Fail2Ban Security for Your Droplet

Fail2Ban is a server side program that will detect people trying to log onto your server and if they make so many failed attempts it will temporarily ban them from trying to log in. This is useful for trying to stop people from brute forcing your Droplet. By default 3 failed login attempts will automatically ban for 10 minutes... and that includes yourself. However, you can make the program ignore your non-VPN IP if you have a static IP address.

apt-get install fail2ban
nano /etc/fail2ban/jail.conf
go down to ignore ip and put your server and person ip in
press control+x and then press y to save
service fail2ban restart

XVroZeQ.png

 

Step 6 - Install OpenVPN

Now we will finally install OpenVPN is order to actually have a VPN deployed. When you install OpenVPN it will automatically make an admin account for the service that we will then set a password for.

wget http://swupdate.openvpn.org/as/openvpn-as-2.0.7-Ubuntu12.amd_64.deb
dpkg -i openvpn-as-2.0.7-Ubuntu12.amd_64.deb
passwd openvpn

xebwSUC.png

 

Step 7 - Connecting To Our VPN

At this stage you can close your PuTTY and open up a web browser. I'm using Google Chomre but you can use what you like. Go into your address bar and type in https://YourIpAddress:943/ - Replace YourIpAddress with the IP of your Droplet. Ignore the certificate license as they are self signed by DigitalOcean. Then type openvpn as the username and then the password is what you set at the end of the previous stage.

spEz7ER.png

 

Hit the download button when this window comes up after you log in. This will install the VPN software onto your computer so it can be used system wide by any application on your computer. You will can also find Android and iOS applications for the VPN software.

HhJInol.png

 

You will then have a window pop up that is part of the install program. Again use the same username and password you used to login via the webpage.

7cky1Yi.png

 

Congratulations you now have your own VPN. I hope you enjoy it and if you have any questions feel free to ask them below!


  • guillaumedsde, qwertywarrior, waraich and 1 other like this

Everytime I hit my funny bone unexpectedly it's like my own personal Pearl Harbour.

Don't call it a grave, it's the future you chose.

Project JAPC Build Log


qwertywarrior
qwertywarrior

    Junior Member

  • Member
  • 9,465 posts
  • LocationIm off the Grid

why not just get a vpn straight away

why VPS and go through the trouble to set it up for VPN ?

 

thank you


If your grave doesn't say "rest in peace" on it You are automatically drafted into the skeleton war.


Johners
Johners

    Gone for a Cheeky Nandos

  • Member
  • 2,502 posts
  • LocationUnited Kingdom

why not just get a vpn straight away

why VPS and go through the trouble to set it up for VPN ?

 

thank you

 

You can still use the server for other things while it functions as a VPN.


Everytime I hit my funny bone unexpectedly it's like my own personal Pearl Harbour.

Don't call it a grave, it's the future you chose.

Project JAPC Build Log


JeanC
JeanC

    Newbie

  • Member
  • 1 posts

Hello,

 

I followed your tutorial and was able to use a London based VPS to host the VPN server. The problem is that my location is detected as being in US. Any idea how to enable a UK based location ?

 

Thanks

 



Johners
Johners

    Gone for a Cheeky Nandos

  • Member
  • 2,502 posts
  • LocationUnited Kingdom

Hello,

 

I followed your tutorial and was able to use a London based VPS to host the VPN server. The problem is that my location is detected as being in US. Any idea how to enable a UK based location ?

 

Thanks

 

I've had that as well but it should still route your traffic through the UK


Everytime I hit my funny bone unexpectedly it's like my own personal Pearl Harbour.

Don't call it a grave, it's the future you chose.

Project JAPC Build Log


gibbsy81
gibbsy81

    Error 404

  • Member
  • 985 posts
  • LocationMelbourne Austrailia

An alternative for people who ain't in the region's that digital ocean serves.







Also tagged with one or more of these keywords: init.d

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users