Build Your Own Free VPN with Oracle Cloud

2022-09-15

In this tutorial, we will build and deploy our own VPN server using Wireguard to an Always Free Oracle Cloud instance hosted in any location of your choice.

Tutorial

Requirements

What is a VPN and why do you need one?

A VPN is a means of creating an encrypted tunnel that establishes a protected network when using public networks. My time in China taught me the importance of VPNs, even though they are useful for more than just spoofing one's location. VPNs give us some modicum of anonymity whilst surfing the internet, allowing us to hide our traffic from our ISPs and other nosey observers. This is especially important on public networks where we are vulnerable to exploitation by bad actors. While there are many VPN providers out there, they have their advantages and disadvantages. One of these disadvantages is the reason for this tutorial -- VPN providers could, in theory, see all your online traffic because it is passing through their systems. While most of them will say that they do not keep logs, we can spare ourselves the uncertainty by building a personal VPN. And, the best part is that it's free.

Introduction

In this tutorial, we will build and deploy our own VPN server using Wireguard to an Always Free Oracle Cloud VM hosted in any location of your choice. According to their website,

Wireguard is an extremely simple yet fast and modern VPN that utilizes state-of-the-art cryptography.

We'll use Wireguard because it is designed to be easy to set up, less resource intensive, and faster than competitors like OpenVPN.

Creating an account on Oracle Cloud Infrastructure

Oracle provides one of the most generous free tiers in the game, and because it's Always Free, instead of automatically upgrading if you go over your limit, they'll simply cut you off. The free tier includes access to Compute (which we will be using for this tutorial), Object Storage, Autonomous Data Warehousing and many more useful resources. The sign up process requires basic identification information such as your name, email, and address.

Required Info

During this process we also pick a home region. According to Oracle, this is where all your data will be stored. It is permanent and cannot be changed later on a free account. This location will be the base location for your VPN so take this into consideration.

Home Region

The last step is to input your credit card information. In my experience, Oracle will not charge you anything, however the card information is used to verify your identity (and probably ensure that the free trial is not abused).

Payment Verification

After confirming your email, you will be directed to the Oracle Cloud dashboard where you can access all the resources.

Creating a Virtual Cloud Network (VCN)

Launching a Linux instance

Connecting to your instance

Allowing UDP traffic

Installing the VPN

Adding a user