VPN or Virtual Private Network allows you to send and receive data across public networks (like the Internet) securely and privately. It’s like connecting two computers with a cable so no one else can eavesdrop the communication.
In case you’re not aware of it, the Internet is very public and insecure place. I don’t want to go into security details, but you don’t have to be an outlaw and still need some privacy like when communicating with your bank account for example.
These days, VPN services of all sorts are very popular, but the question is if you can really trust the VPN provider and its employees that they will honor your privacy. I believe there’s no need to trust anyone if you can set up your very own VPN server for the same price you would pay for such a service or even cheaper!
All you need is a server connected to the Internet and a good, secure VPN software to run on it. If it sounds difficult, it really is not! In this article, I will show you everything step by step.
VPS stands for Virtual Private Server and it means that you can rent a server to do whatever you want, like installing your own VPN 🙂 You can imagine such a server as a bare-metal piece of hardware, but most of the time, it’s just virtual operating system running on one of many real hardware servers in some data center. It gets more complicated but for our needs, it will suffice that you understand that getting a server connected to the Interner is a matter of few mouse clicks these days.
There are many VPS providers (Digital Ocean, Linode, and Vultr among others) that will let you configure and create your own server for a decent monthly payment. Want more RAM, more space, more processor cores? No problem. You can even select the country where your server will live.
In this article, we will use cheap VPS from Vultr because running VPN is not very resource-demanding activity.
Once you have your account ready, go to Account, enable API if disabled, copy your API Key and click the Allow All IPv4 button:
That’s all you need to do in your Vultr account for now.
There are some quite popular scripts on Github that will allow you more or less flawlessly to set up VPN almost automatically, but after many failed attempts, I have decided to try Algo and never looked back. Algo works best on Mac
If you want to understand how Algo compares to commercial VPN services, Streisand or OpenVPN, feel free to read this article Meet Algo, the VPN that works, I will wait.
Save the zip file to the location of your choice, it doesn’t really matter where you store it as long as you remember the path since we will need to access it from Terminal. For your own sanity, I suggest you save it to your Downloads folder. Unzip the package so you have this in your Finder:
Open the config.cfg file in a text editor of your choice, delete default user and add yourself. Save the changes.
Create a new file inside the algo-master directory and call it algo-vultr-api-key.ini. Open it with your favorite editor and place this text inside:
[default]key = paste the API key from Vultr here
You need to paste the API key you have copied from your Vultr account to this file. Once you’re done, save the changes:
Run Terminal, navigate to the algo-master directory and run this command:
When asked for the local path of your configuration INI file, type the path to your algo-vultr-api-key.ini. If you’ve followed this tutorial without any individual changes so far, typing ~/Downloads/algo-vultr-api.key.ini should work.
Wait for the script to finish its job and write down the password. You will need it later to install certificates to your devices and this is the only opportunity to get it!
Now you can go back to your Vultr account and remove Any IPv4 access to your VPS.
Go to the algo-master/configs/your_server_ip directory and double-click the your_name.mobile.config file to install the certificate on your Mac. Use the password you have written down in a previous step (hopefully).
Use the same file to install certificates on your mobile devices. The easiest way to get it to your iPhone and iPad is via AirDrop.
Ok, that’s it! Now you have your very own VPN as long as you keep the Vultr VPS and are willing to pay for it 🙂