VPNs, or Virtual Private Networks are a popular way to stay safe online. All outgoing network traffic is funneled through an external server when connected to a VPN.
VPNs are commonly used to bypass blocked websites and to stay safe on public Wi-Fi networks.
However, some VPNs are not safe to use. Many popular providers will log details of users which can then be sold to third parties. Some insecure services also leak connection information leaving users unprotected.
Despite there being excellent VPN choices available on the market, hosting your own VPN server is an option to which there are advantages and disadvantages.
- You’re in control of your data.
- It’s usually cheaper.
- You can use the VPN server for other things like hosting a website or installations.
- Websites and services that ban VPNs probably won’t detect yours, because it won’t be on an IP block list. This doesn’t apply to Android apps, since they can detect when any kind of VPN/proxy is being used.
- Anonymity isn’t possible, since the VPS host will have your name and payment information.
- Your total bandwidth will be limited.
- You won’t get special features that some VPN services provide, like tracker blocking, unless you have the technical knowledge to set them up yourself.
- You can’t easily switch between different countries and locations.
Set up a VPS
First we need to create a VPS, which is the virtual machine that the VPN server will run on.
Enter a password in the ‘Root Password’ box. Make sure the password is secure and unique. Then click the ‘Create’ button and wait for the VPS to finish generating and booting.
Log into the VPS
The server doesn’t have a graphical user interface, like Windows or macOS. It only has a command line.
Once you have your VPS open, click the ‘Launch Console’ button at the top-right corner. This will open a web-based terminal, as seen in the screenshot below, and you’ll be prompted for a login. Type “root” (without the quotes), press Enter, then enter your root password, and press Enter again.
After that, you should be logged in and greeted with a “Welcome to Ubuntu” message.
Set up the VPN
The script will ask you for your IP address, what protocol to use, and other info. Many networks block the default OpenVPN ports, so changing it to 443 (the port used for HTTPS traffic) can prevent some types of blocks. After that, enter your name when asked. The script will then install the required software and set everything up.
Download login info
The easiest way to transfer the .ovpn file to your device is to temporarily start a web server, so you can download the file using any web browser.
Once the server is running, paste the IP address of your server (located on the Linode Summary page) in your browser’s address bar.
Connect to the VPN and secure the server
Once the VPN is set up and downloaded, the connection file is ready to be tested out.
Since your VPN is an always-on server that will be receiving and transmitting personal data, there are a few extra steps you should take to reduce server-side security vulnerabilities.
Two-factor authentication should be set up for the account.