Making Your Private VPN🔐
Tags: devops, networking, cybersecurity
Published: 2022-04-12 12:50:41

---
title: Making Your Private VPN🔐
published: true
date: 2022-04-12 12:05:25 UTC
tags: devops,networking,cybersecurity
canonical_url: https://www.thegogamicblog.xyz/posts/setting-up-your-private-vpn
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f1uwe2z6fyqrho3hy9q7.png
---
In this post, we will be building our own private VPN using a VPS server[](https://gogamic.com/ref/vultr)and [OpenVPN](https://openvpn.net/).

## Why Private VPN?🤔

Have you ever wondered when you have access to VPN providers? why should you ever consider building your private VPN? Let me help you answer this question. So basically a VPN is something that sits between your network and the Internet. It makes your IP anonymous by sending the IP of the VPN provider's server that you are connected to but the problem is that your network traffic can be easily seen by your VPN provider.

It's a proven fact that these VPN providers sell your data to scammers and advertisers.

If you like to learn more about VPNs do check out this [Post](https://techcrunch.com/2017/01/01/wtf-is-a-vpn/).

## What is OpenVPN?👐

![Making Your Private VPN🔐](https://res-4.cloudinary.com/gogamictechnologies/image/upload/q_auto/v1/ghost-blog-images/OpenVPN_logo.svg)

OpenVPN is a VPN system that implements techniques to create secure point-to-point or site-to-site connections in routed or bridged configurations and remote access facilities. It implements both client and server applications. It has a Free version which is one of the reasons why I am onto it🤑🤑:)

## Getting Started😀

We will not be discussing how to create a server. If you like to more about creating a server do read this [Post](https://medium.com/wolf-crypto/how-to-setup-a-vps-on-vultr-d2811cb43bda). I recommend [Vultr](https://gogamic.com/ref/vultr)(Use this link to get $100 credits😉) if you're looking for a cheap and best VPS server provider

## Installing Ghost  

1. First, we should figure out the public IP of our instance. For that, we must run `wget -qO - ipinfo.io` which will give  you similar output to this ⬇
```json
{
  "ip": "11.22.33.444",
  "hostname": "8.9.8.1.bc.googleusercontent.com",
  "city": "Singapore",
  "region": "Singapore",
  "country": "SG",
  "loc": "1.2897,103.8501",
  "org": "AS396982 Google LLC",
  "postal": "018989",
  "timezone": "Asia/Singapore",
  "readme": "https://ipinfo.io/missingauth"
}

```

2. Now we can install OpenVPN by running the following commands

```bash
wget https://git.io/vpn -O install-open-vpn.sh
chmod +x install-open-vpn.sh
```

3. Then run `sudo bash install-open-vpn.sh` for the shell script to get executed

- Initially, it will ask you for an IP address to use(Make sure you select your pubic IP address)

![Making Your Private VPN🔐](https://www.thegogamicblog.xyz/content/images/2022/04/IP_address_selection.png)

- Then it will ask you to choose the [Network protocols](https://www.manageengine.com/network-monitoring/network-protocols.html) to use (Defaults to UPD)

![Making Your Private VPN🔐](https://www.thegogamicblog.xyz/content/images/2022/04/network_protocol_selection.png)

- Now you will have to choose the PORT on which you want OpenVPN to listen (Defaults to **1194** )

![Making Your Private VPN🔐](https://www.thegogamicblog.xyz/content/images/2022/04/port_selection.png)

- Now it will ask you to choose the [DNS (Domain Name System)](https://www.cloudflare.com/en-in/learning/dns/what-is-dns/) Server to use. I Personally prefer Cloudflare's [1.1.1.1](https://one.one.one.one/). Feel free to choose the one you like 

![Making Your Private VPN🔐](https://www.thegogamicblog.xyz/content/images/2022/04/DNS_server_selection.png)

- Name your client and hit **enter**

![Making Your Private VPN🔐](https://www.thegogamicblog.xyz/content/images/2022/04/client_name.png)

- Once the installation is completed. It will give you the location of the client file. You either `cat file_location` or spin up a temporary web server using `python –m SimpleHTTPServer` and download it by visiting your server's IP

![Making Your Private VPN🔐](https://www.thegogamicblog.xyz/content/images/2022/04/client-file-location--2-.png)

- Now you will have to download the [OpenVPN Client](https://openvpn.net/community-downloads/) on your PC/Laptop
- Once you have downloaded and the installation is complete. You will have to right-click on the OpenVPN client Icon.

![Making Your Private VPN🔐](https://www.thegogamicblog.xyz/content/images/2022/04/open_vpn_icon.png)

- Then You have to choose Import --> Import file then choose the file that we downloaded or copied from our server.

![Making Your Private VPN🔐](https://www.thegogamicblog.xyz/content/images/2022/04/import_open_vpn.png)

- Once the file is imported. Now you will see an option to connect Just click on it and you're good to go.

![Making Your Private VPN🔐](https://www.thegogamicblog.xyz/content/images/2022/04/connect_open_vpn-2.png)

- Now if you visit [ipinfo.io](https://ipinfo.io/) you will now see the IP of your server instead of your IP address 😉

## Conclusion

- Just a quick reminder, If you are using major cloud platforms like [Digital Ocean](https://gogamic.com/ref/do), [Google Cloud](https://cloud.google.com/), and [Amazon web services](https://aws.com). They have this feature called **one-click install** wherein you will get your server up and running with OpenVPN pre-installed.

- I hope this post was educational and informational to you. Do let me know in the comments section below if you guys have any sort of queries on your mind💡 


P.S:- [Vultr](https://www.vultr.com/?ref=9086643-8H)(Get a $100 credit by registering using this link) is a good hosting choice if you're looking for one 
Thanks For Reading!😀