Set Up Your Own VPN Server in the Cloud for Free or Cheap

VPN Server

Page 3 – Downloading and Configuring Algo

Downloading and Configuring Algo

Now it’s time to download and install Algo. The installation files you need are hosted on GitHub, but you can quickly download the build files for your Mac on this page. Unzip the file where you want, and it will create a folder called algo-master. Now, follow these steps.

Open Terminal, then type cd followed by the “algo-master” directory location. If you don’t know where it is, just drag and drop the folder into Terminal. Once done, hit Enter.

Now it’s time to get everything else we need downloaded and configured. Type these commands, each on its own line.

python -m ensurepip --user

Now press Enter.

python -m pip install --user --upgrade virtualenv

Again, press Enter

python -m virtualenv env && source env/bin/activate && python -m pip install -r requirements.txt

Press Enter one more time.

If you’ve never installed the cc command line tools, you’ll be prompted to do that. Go ahead and agree, it’s perfectly safe and required to move forward.

Next, when everything is done, type sudo nano config.cfg and press Enter. You’ll be asked for your administrative password, and then a text editor will open. Under the section called Users in the file, type in the names of any users you want to create. These are the people who will have access to your VPN. We’ll talk later about how to add users; it’s painless. Once you’ve added your users, press Control-X to save your changes and exit the text editor.

Installing Algo to Your Cloud Account

Next, we’ll install Algo itself. Just stay in Terminal, and type the following command to kick off the installation process.

./algo

You’ll be asked several questions. If you chose Amazon EC2 for your cloud provider, choose that by typing in the correct number. Type any name for your VPN and choose the closest server location.

From the CSV file you downloaded earlier, get your AWS Access Key and your AWS Secret Key. Copy and paste each number into the Terminal window when the Algo installer asks you for them.

On the other hand, if you chose DigitalOcean, the process is much easier. Make sure you have an API Token from DigitalOcean’s website, and be ready to paste that into Terminal. Choose the option for DigitalOcean, and then you’ll be asked for your API key. Again, type any name for your VPN and choose the closest server location to you.

Algo’s installer will ask about VPN On Demand. This feature allows your Apple devices to automatically connect to the VPN when they need it. Otherwise, you have to remember to turn it on each time. This isn’t so challenging on macOS, but can be a bit of a bear on iOS. Go ahead and answer Yes to that question.

I also answered Yes to the security enhancements, HTTP proxy, and local DNS resolver. You’ll also be asked about trusted Wi-Fi networks. This is entirely up to you, but you should leave it blank if you want to use your VPN from home. If not, enter in the names of your trusted networks with a comma between each one. I’ll explain how to change this later.

The rest of the options are your choice, but I said no to them all and my VPN is safe and secure.

Once you’ve answered everything, Algo will install itself to your server instance. This will take between five and 10 minutes, so go grab a coffee. When the process is done, you’ll be ready to connect to your VPN. I would recommend copying and pasting the final screen into a text file for future reference.

Up next: Connecting to your VPN server from macOS and iOS

8 thoughts on “Set Up Your Own VPN Server in the Cloud for Free or Cheap

  • You made a bit of an error. Earlier, you said you said No to whether you wanted the CA certificate retained, but at the end you said that you could update users—using a method that requires the CA certificate to be retained.

  • I’m really enjoying your articles, Jeff (and Melissa, and Bob etc.). Great user-ccentric technical articles are something I’ve really missed as they’ve become less common on most Apple sites these days. This is something I really appreciate about TMO.

  • @geoduck: I have good news for you! DigitalOcean has data centers in other regions than the US. Specifically, they have data centers in Amsterdam, Singapore, London, Frankfurt, Toronto, and Bangalore. Installation is so simple that you can destroy your existing droplet and create a new one in a matter of minutes, so changing locations from day to day isn’t too strenuous.

  • The one issue with this is the location of the server. I’m specifically looking for a server outside of the US, and other Five-Eyes countries. I like existing services because I can run my Mac through Germany, one day, the Netherlands the next and have my phone going through Singapore. If my personal VPN server is set up in the US, then it’s a fixed target in a vulnerable location.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.