VPN or a Virtual Private Network allows you to establish a secure connection to another network over the internet. All your data going through a VPN server is secure and encrypted. Nowadays, VPNs are getting popular among internet users, but not for the reason they originally invented.
Enough talking about VPN! Let’s get into the topic.
Why own VPN server is better?
There are lot of VPN apps in the market like NordVPN and ExpressVPN. However they are subscription services which require you to pay a monthly fee to use their service. Prices may vary service to service but as of the time I am writing this article, they are from $8 to $13 per month.
However setting your own VPN server is way better secure and cheaper. By using a VPN, your ISP (Internet Service Provider) loss the ability to identify what website you visit or what content you view. But when using a VPN service, that service provider can still track and log you. When using a self-hosted VPN, no one can track you!
- VPS (Virtual Private Server) with root access
- A SSH client
- A FTP client
- OpenVPN Client
If you already own a VPS, you may use that. If not, you have to buy a one. You can buy a VPS as low as $1 per month from VirMarch. However if you are a one who tries to unblock region-restricted websites or content, you should careful when choosing a VPS. For example if you need to unblock US exclusive Netflix Movies and TV Shows, you should buy a US VPS.
Read Also: Apple Music vs Tidal: Which is Better?
Secondly, we need a way to connect to the VPS. If you are a Mac or a Linux user, you don’t need any third party software. But in case you are using Windows, you need a SSH client. I prefer PuTTY, it’s free.
Moreover we need a FTP client too. I use FileZilla and it is available on macOS, Windows and Linux.
Let’s setup VPN server
In this guide, I’m using CentOS 7 on the server. But you may use Debian or Ubuntu. However if you are a newbie, I recommend you to use CentOS 7 as you can follow this guide without a difference.
Connect to VPS
- Open PuTTY
- Enter your server IP in “Host Name” field
- Click on Open
Mac or Linux
- Open Terminal
- After that Run this command in your terminal (Replace YOUR_SEVER_IP)
ssh [email protected]_SEVER_IP
Type your password when it is asked
Alright! Now we are inside our VPS.
It is a good practise to update the server when setting something on a fresh VPS.
sudo yum update
If your server running Ubuntu or Debian,
sudo apt-get update && sudo apt-get upgrade -y
Install OpenVPN Server
To use a VPS as a VPN server, we need a VPN server software. There are two popular softwares out there; OpenVPN and WireGuard. However, they both have their own pros and cons. Although WireGuard is great too, in this guide I am using OpenVPN.
wget https://git.io/vpn -O openvpn-install.sh && bash openvpn-install.sh
To keep the default options, press Enter for all configurations. Then you have to wait until this script does all for you!
Connecting to VPN
This is where we need a FTP client.
- Enter sftp://SERVER_IP in “Host” field (Replace SERVER_IP with your server IP)
- After that give ‘root’ as the username
- Likewise enter your server password in “Password” field
- Copy “client.ovpn” to your client computer
- Import that profile to OpenVPN client software
That’s it! Now you can connect to your own VPN server.