How to run your own VPN server for free?

Nowadays, there are so many VPN providers (free or paid) that running your own instance is really not necessary and depending on your use case, might not even be any more private or secure.

This endeavour is purely for my own curiosity and for getting myself more familiar with DigitalOcean.

This tutorial is written for macOS but I’d imagine it wouldn’t be too different for Windows.

  1. Download algo, unzip the file and place it anywhere you like.
  2. Launch Terminal. Type the following into the Terminal and press enter (replace with the actual path).

cd /path/to/algo-master

  1. Type the following and press enter.

python -m ensurepip –user

  1. Type the following and press enter.

curl https://bootstrap.pypa.io/get-pip.py | python

  1. Type the following and press enter.

python -m pip install –user –upgrade virtualenv

  1. Type the following and press enter.

python -m virtualenv env && source env/bin/activate && python -m pip install -r requirements.txt

  1. Type the following and press enter.

chmod og-rw ~/.netrc

  1. Open the /algo-master/config.cfg file in your text editor. Add as many (or as few) users as you want.

  1. Go back to the Terminal window. Type the following and press enter.

./algo

  1. Enter ‘1’ to choose DigitalOcean.

  2. Sign up via my referral link to receive $10 free credit which is more than enough to run your VPN continuously for at least 1 or 2 months. After signing up, navigate to the ‘Applications & API’ page to generate an API key.

  3. Click ‘Generate New Token’.

  4. Enter whatever you want for the ‘Token Name’, it doesn’t really matter (I entered ‘algo’ for convenience sake).

  5. Click the token to copy it to your clipboard and paste it into the terminal and press enter.

  6. Name the vpn server whatever you want, again, it doesn’t really matter.

  7. For the region of your VPN server, it’s generally better to have a server that’s closest to where you are physically, as it will have a lower latency and better performance. However, if you are planning to utilise the VPN to get around geographically restricted content, make your choice accordingly.

  8. If you have no idea what the next few questions mean, just enter ‘n’ for all of them. Once you’ve answered all the questions, the installer will start the installation of your VPN server.

  9. Wait.

  10. Once setup is complete, DO NOT CLOSE YOUR TERMINAL WINDOW IMMEDIATELY. Take note of the p12 password.

  11. Navigate to the /algo-master/configs folder and you will find a new folder with a corresponding IP address. Inside, you will find a .mobilconfig file. Open it.

  12. You will be prompted to enter the p12 password and your macOS password.

  13. …and you’re done. You can now manage your VPN connection in your Network preferences.

15 June 2018

index