[Oracle VPS] Create your own VPN Server always free
Table of Contents
VPS Oracle - This article is part of a series.
Introduction #
This article is part of a series dedicated to hosting free services for life on a private server. In this one, I’ll show you how to create your own VPN server.
What is a VPN and how does it work? #
A VPN creates a secure “tunnel” between your device and a remote server, which may be managed by a mainstream provider (such as NordVPN, CyberGhostVPN,…), by your company or in the context of this article by yourself!
All data passing through this tunnel is encrypted, which means that it is transformed into a format that is unreadable by anyone trying to intercept it.
The aim of a VPN is simple: to create a virtual, isolated and secure link between two points.
- VPN connection: You connect to a VPN server via an application called the VPN client.
- Data encryption: All data you send and receive is encrypted by the VPN client.
- Transmission via VPN server: Your encrypted data is sent to the VPN server. This server acts as an intermediary between your device and the Internet.
- Decryption and transmission: The VPN server decrypts the data and sends it to its destination on the Internet (e.g. a website).
- Data return: The data returned to your device passes through the VPN server again, where it is encrypted, sent to your device and finally decrypted by your VPN client so you can read it.
Or more simply:
VPN use cases #
VPNs are generally used in 2 ways:
- In a professional context
- in a personal context
Professional use #
In a professional context, a VPN is generally used to access corporate resources (applications, files, etc.) securely, even if you are physically outside the company.
For example, to enable employees to telework or service providers to access certain resources, a company will set up a client-to-site
VPN:
Another example is a very large company with subsidiaries abroad. If employees in Paris need to access resources located in New York, or vice versa, they will almost certainly use a site-to-site
VPN:
Personal use #
In the personal sphere, we generally use a consumer VPN to be anonymous or to access geo-restricted resources. When you take out a subscription, you can access servers located in several different countries, depending on the provider:
Why use your own server? #
As we saw earlier, whoever manages the server can consult the data passing through it at any time, and this is the case for VPN operators in the general public.
Of course, they’ll tell you otherwise, and even make a sales pitch out of it - some may respect that - but don’t forget that nothing technically prevents them from selling your data, not to mention collaborating with government authorities.
Yes even for “VPN no log”, no noob no scam.
All right, maybe you’ve followed a good tuto to improve your privacy without relying only on a VPN or you just don’t need that level of privacy.
“As long as I can access US or Japanese Netflix, I don’t care “.
Well, the big streaming platforms are setting up more and more processes to detect whether you’re using a VPN.
You can quickly find yourself faced with this type of message and be unable to do anything about it.
I won’t go into the technical details of how Netflix can detect if you’re using a VPN, here are some resources for those who want to dig in:
Solution chosen: OpenVPN #
Did you know that all consumer VPNs rely on the same basic protocols to establish a secure tunnel?
That’s right! If you look at the technical documentation for these VPNs, you’ll soon realize that they all use the same protocols:
OpenVPN
IPSec / IKEv2
Wireguard
- …
You can even choose which protocol to use in some of them:
While commercial VPN services offer convenience and support, the underlying technology is accessible to all. With a little technical knowledge and time, anyone can set up and use a VPN for free.
That’s exactly what we’re going to do with the OpenVPN
protocol.
Pros #
We’ve chosen this protocol because it offers a number of advantages:
- It’s open-source, meaning that its source code is publicly available. This means total transparency and continuous improvement of the protocol, as anyone can contribute to the code.
- It has a large community, which guarantees regular updates and extensive documentation.
- It’s multi-platform, so you can use it on Windows, MacOS, Linux, Android or iOS.
- It’s free for life!
Cons #
Although this solution is free, secure and simple, it does have certain limitations:
- the country of the VPN server
- the number of simultaneous connections
Indeed, as we saw earlier, a company offering a VPN for the general public has several servers in several countries. When you pay, you can choose which server to access, and therefore which country.
In our case, we’ll only have access to one country → the one where we create our Oracle account. When creating your account, you’ll be asked which region to use, you won’t be able to change once the account has been created.
What’s more, OpenVPN documentation, specifies that you are limited to 2 simultaneous free connections
.
In comparison, offers like CyberGhost VPN give you access to 7 simultaneous connections or NordVPN to 10 simultaneous connections.
For “personal
” use, OpenVPN’s free offer is perfectly adequate.
For “family
” use, however, you may need to look at consumer solutions.
Well, now that you know everything, let’s get started!
OpenVPN server creation #
→ Read the introduction of this serie
Creating an instance #
To start with, we’ll need to create an instance. The great thing about Oracle Cloud is its marketplace, think of it as an online store.
In the marketplace, you can find images of VMs with instances already configured.
And just in time, there’s an image for making your own OpenVPN server, which is what we’re going to use!
Go to this page and click on “Get App” :
Select the “Commercial Market” option and log in by clicking on “Sign in”:
As you can see, this image is totally free!
Accept Oracle’s terms of use and click on “Launch Instance”:
You’ll arrive on the instance creation page - everything’s already done for you!
This instance uses a Standard.E2 Micro VM, and by default features:
- 1 OCPU
- 1 GB RAM
- 47 GB storage space
- OS: Ubuntu
Here I’m simply naming the VM but I’m not touching anything else:
You can create the instance:
Once the instance has been created and is ready for use, make a note of its IP address:
ubuntu
user is not authorized to connect remotely to this VM, so another user has been specially created: openvpnas
.Connect to your instance with this user via the SSH command:
ssh openvpnas@[IP_of_your_VM] -i [ssh_key]
Installing OpenVPN #
On your 1st connection, OpenVPN will ask you to accept its terms and conditions (EULA):
Type “yes “ to accept:
OpenVPN will ask you several questions for its configuration, you can simply press Enter at each question to validate the default configuration:
After a few questions, OpenVPN will ask you which user can access the admin panel. You can leave the user openvpnas
.
You’ll then need to assign a password and confirm it:
Once you’ve entered your user name and password, OpenVPN will complete its installation and display information on how to connect to the admin panel:
Let’s configure the firewall.
Firewall configuration #
Here are the ports to open:
On Oracle, this is the result:
You can now connect to the OpenVPN admin panel via the url: https://[IP_of_your_VM]/admin
.
Continue to the application:
Log in with the user you created earlier:
And accept EULA (again):
VPN configuration #
We’re now going to configure the OpenVPN server.
First of all, OpenVPN sets your subnet’s IP address (the one starting with 10.0…) as the default IP, but nobody will be able to access it. You’ll need to set your VM’s IP address in the network settings:
You will then need to authorize Internet traffic to be routed by the OpenVPN server and to enter public DNS, in this case those of CloudFlare, in the VPN settings:
Create a user who will be authorized to use the OpenVPN server and who will be able to connect automatically:
Finally, update the server :
Wait a few seconds for the server to take these changes into account. Your OpenVPN server is now ready for use!
Using your own VPN #
You can now use your own VPN server, and connect to it in 2 ways:
- Install a pre-configured OpenVPN client
- Install an OpenVPN client and configure it yourself
Installing a pre-configured OpenVPN client #
Go to the url https://[IP_of_your_VM]
with your user account :
You can download an OpenVPN client already set up on the desired OS:
Once downloaded, install the client (follow the installer steps):
And that’s it! The OpenVPN Connect client is now installed on your machine, with your profile already set up:
All you have to do is click on the button to use your VPN server:
Installing an OpenVPN client and configuring it yourself #
If you don’t install the OpenVPN client already set up, then you’ll have to do it yourself.
Download the client from: https://openvpn.net/client/
Install the client and enter your server’s URL:
Accept the certificate :
Enter your user account details:
Click on Import and voilà! You can now log in:
Sharing access to your VPN server #
If you want to share access to your VPN server without giving away the user account password, you can share the user profile:
You will obtain this type of file:
Anyone wishing to access your VPN server simply needs to download the OpenVPN client and import the profile:
VPN test #
You can now test your VPN with the WhatIsMyIPAddress website.
Without VPN, you can see my ISP’s IP address and my approximate location:
With VPN, you can see that the IP address detected by the site is the one from my OpenVPN server and that the ISP and location correspond to the Oracle server:
The OpenVPN server is now up and running!
Conclusion #
In this article, I’ve shown you how to create your own OpenVPN server free for life using Oracle Cloud Infrastructure’s “Always Free” offer.
The aim was to provide you with practical knowledge while introducing you to the field of networking and IT security.
After reading this article, you’ll now know :
- What a VPN is
- How a VPN works
- The different types of VPN
- Create your own free VPN server for life
I hope you’ve enjoyed reading the article, if you have, please feel free to like it and share it with any friends or colleagues who might be interested!