I’ve always been a huge proponent of hosting your own services, but they do come with a few drawbacks – they require some technical experience and often don’t come with a warranty. That is, if you enter something incorrectly into the command line you could potentially break something. That shouldn’t dissuade you, though! Self hosted open source projects are all about tinkering, learning, and having fun.
Perhaps one of the most well-known cloud VPS providers is Vultr, who also provides hosting for many VPN providers under the name CHOOPA. In this tutorial I’ll show you how you can easily host your own private VPN on their servers.
If you are the only person using this VPN, you can choose the basic Cloud Compute server with 512MB of RAM and a regular SSD. If you intend to share the server with multiple people, you will need to scale up accordingly.
Where you want your server to physically exist is entirely up to you. If you’re using it to bypass geo restrictions, then choose the country based off what service you’re trying to access. Otherwise, a good rule of thumb is to choose a server that at a minimum is in your time zone. If you go further than that your latency and speeds will be negatively impacted. So, for example, if you are on the west coast, a server in Washington, Oregon, California would be a fine choice.
Retrieve your registration keys
Now that your server is up and running, it’s time to switch gears for a second. Since this VPN configuration runs on Utunnel, you will need to head over to their website to create an account and link the IP of your newly created server. Once you’ve set that up, you will need to log into your server either by web console or terminal.
After the successful login, execute the following commands.
First, disable the default firewall rules. Utunnel will load it’s own firewall rules automatically.
sudo systemctl stop ufw && systemctl disable ufw
Now go ahead and run the following commands.
sudo mkdir /utunnel && cd /utunnel
sudo wget https://files.utunnel.io/production/deploy/install_bundle_20.tar
sudo tar -xf install_bundle_20.tar
In the next command, you need to replace YOUR_REG_TOKEN with the registration token you copied from the uTunnel Server Details page .
sudo /utunnel/bin/utnservice register YOUR_REG_TOKEN
Now it’s the time to start UTunnel Service on your server. Run following command for the same.
sudo /utunnel/bin/utnservice start
Make sure that inbound connections to the following ports are allowed to accept VPN connections.
Ports used for OpenVPN connections
- TCP 443
- UDP 443
- UDP 53 (if scramble VPN is enabled)
Ports used for IPSEC connections
- UDP 4500
- UDP 500
Now your server would be ready to accept VPN connection. Invite users into your server and start using VPN.