Connect with us


How to make a VPN server?

Setting up your own VPN service can be challenging, but using a cloud-based solution is easy.

online shopping with a vpn
Image: Unsplash

A VPN in today’s world has become a necessity to keep your online identity safe and secure from prying eyes. There is competition in the industry among the best VPN providers to offer the best services to the users but even the mightiest VPN services have flaws because of which you should know how to make your own VPN server with the limited resources you have in your hand!

It is true that you’ll need to carry out some extra efforts to make your own VPN server, but hey, there are no third parties involved. After you set up your VPN server, make sure you check if your VPN is working or not.

  • You can make your own VPN server on Amazon Cloud Services and set up client devices to allow using your VPN server.
  • If you have a router with VPN capabilities, you can set up a VPN server on your home network.
  • In case you don’t have a VPN router, you can still make a VPN server on your home network by flashing your router’s firmware.

 How to Make A VPN Server On Cloud? 

Setting up your own VPN service can be challenging, but using a cloud-based solution is easy. Setting up the system means just entering data into an online form and billing information. You don’t need to bother with setting up a computer or router as it manages everything for you.

 Create an Account on Amazon Web Services 

  • Go to the Amazon Web Services page and click on ‘Create an AWS Account’.
  • Log in with your account.
  • Under the Security, Identity, & Compliance panel, go to Services and then to IAM.
  • Click on Users and then Add User.
  • Create a username and then click on Programmatic Access. Click Next.
  • Click on Attach Existing Policies Directly.
  • Tick on Administrator Access by typing ‘admin’ in search. Click Next.
  • Click on the Download CSV Button which consists of some important files you’ll need later.

 Set-Up and Run Algo Dependencies

Setting up Algo on your Windows computer can take a few minutes. Read the instructions, download Algo, and run it followed by the command line to install and configure it.

On Windows 10

  • Go to the Settings and head to Update & Security.
  • Click on For Developers and enable Developer Mode.
  • Go to the Control Panel and then head to Programs.
  • Turn On windows features.
  • Select Windows Subsystem for Linux by scrolling down.
  • Click on OK.
  • The program will be installed on your computer.
  • Restart your computer.
  • Now check if Linux Bash is installed on your computer or not by typing ‘Bash’ in the search panel.
  • Open Bash and install the software after answering some questions.
  • As soon as the installation completes, type these commands next,
sudo apt-get update && sudo apt-get install python-pip python-setuptools build-essential libssl-dev libffi-dev python-dev python-virtualenv git -y
  • Use this command below to clone the repository in the next step,
git clone && cd algo
  • Now you have to create a list of users, type nano config.cfg and hit enter button.
  • The command will display a text editor on your screen, type in the names of users allowed to use your VPN.
  • To save the list, enter Ctrl+X and close the editor.
  • In the terminal, enter the command ./algo which will start the installation.
  • The Amazon EC2 Provider key is 2, type 2 if that’s the provider you’re looking for.
  • Enter a VPN name.
  • Choose a server location (Note that if you choose a server location nearer to your actual location, the performance will be slightly better if you choose a faraway server).
  • In this next step, open the CSV file which was downloaded from AWS (In the last step of the previous section).
  • Copy your AWS Access Key and AWS Secret Key, paste the keys in the sections whenever necessary.
  • In the VPN On Demand section, choose whether or not you want your VPN to work automatically by choosing Yes.

On Linux and macOS

These instructions will work on any mac but note that for Linux, these instructions are for Debian Linux only. The commands are different for other Linux variants.

  • Download Algo from here.
  • Extract the algo-master zip file on your computer.
  • Type cd in your Linux terminal, drag and drop the algo-master folder in your terminal.
  • It should be looking like,
cd /Users/hammalfarooq/Downloads/algo-master
  • Enter the following commands next,
For Linux, type in these commands.

$ sudo apt-get update && sudo apt-get install \

build-essential \v

libssl-dev \

libffi-dev \

python-dev \

python-pip \

python-setuptools \

python-virtualenv –y

For macOS, type in these commands

$ python -m ensurepip –user

$ python -m pip install –user –upgrade virtualenv

  • Then carry on installing the remaining algo dependencies by entering the commands below,

$ python -m virtualenv –python=`which python2` env &&

source env/bin/activate &&

python -m pip install -U pip virtualenv &&

python -m pip install -r requirements.txt

Note that you might need to install cc if your operating system is macOS.

  • Type the command sudo nano config.cfg and enter to create a list of users who are allowed to use your VPN.
  • To save the list, press Ctrl+X.
  • In the same terminal, enter ./algo to start the installation.
  • The Amazon EC2 Provider key is 2, type 2 if that’s the provider you’re looking for.
  • Enter a VPN name and choose a server location. (Note that you will experience good speed if you choose a VPN server location nearer to your actual location).
  • Open the CSV file downloaded in the previous section from AWS.
  • Copy your AWS Access Key and AWS Secret Key and paste wherever necessary.
  • You can either enable VPN to work automatically by choosing Yes from the VPN on Demand section or operate it manually.

 Set Up Your Devices by Configuring VPN

To set up and configure your VPN on a new device, all you need to do is set up a profile.

For Apple Devices

  • Double click the .mobileconfig file which is in the algo-master folder inside the configs folder.
  • The installation will begin and a profile will be created.
  • Open the .mobileconfig file on your iOS device (email it or Airdrop it) and set up a profile to connect to the VPN.
  • Delete the profile when you want to disconnect from the VPN.

For Android Devices

  • Install strongSwan VPN Client from Google Play Store.
  • In the configs folder, find the P12 file.
  • Transfer the P12 file to your Android device.
  • Open the P12 file through the strongSwan VPN Client and connect to your VPN.

For Windows

  • Go to the config folder and copy the files PEM, P12, and PS1.
  • Paste the files somewhere else on your computer.
  • Click and import the PEM files in the Trusted Root certificate folder.
  • Open Windows Powershell and change the directory to where you pasted the PEM, P12, and PS1 files.
  • Then type this command and enter,

Set-ExecutionPolicy Unrestricted -Scope CurrentUser

  • Enter your Powershell script name and press Enter.
  • In the last step, type in this command and press Enter to complete the setup.

Set-ExecutionPolicy Restricted -Scope CurrentUser

You are now successfully connected to your VPN and your traffic is secure!

How to Make A VPN Server On VPN Router? 

The primary requirement for this method is that you should know what a VPN router is and how it is different from a regular router. 

The easiest way to set up a VPN is by using your own router which supports VPN. But if you don’t have a router that includes this option, then this method will probably not work. Keep on reading to know more about how you can make a VPN server if you don’t have a VPN router.

  • Run a search on your router for “VPN” to see if it is compatible with the service.
  • You found your router manual, right? If not, you can find the routing settings page by typing or in your browser and then finding the VPN section of the configuration page.
  • When you arrive at the VPN section, set up a VPN server following the instructions.
  • Specify a VPN protocol and set up your VPN by typing in a username and password. Restart the router to apply the settings.
  • To utilize the VPN on any device, install your router configuration files and extract them in your device.

How to Make A VPN Server By Flashing Your Router? 

One more alternative to setting up a VPN on your home network is by flashing the firmware of your router. Flashing requires research before you do it, so be careful if you decide on this technique. Basically, you are going to install an operating system onto your router that includes features such as VPN-hosting–thus allowing you to host a VPN.

It is advised that you check the compatibility of your router if it supports DD-WRT or OpenWrt before flashing your router.

Flashing Router 

  • Download the firmware compatible for your router on your computer and plug in your router with the computer.
  • With an ethernet cable, plug one end of the cable to the Router’s LAN port and one end of the cable to the computer’s LAN port.
  • Open your favorite browser on your computer and access the router’s configuration page.
  • Go to the upgrade firmware section of your router
  • Flash your router by the firmware downloaded in the first step.
  • Follow the instructions carefully and flash your router’s firmware.

Create A VPN Server 

  • Proceed to your router’s configuration page, then follow the steps to create your own VPN server.
  • On your router’s configuration page, go to the VPN section.
  • Turn on the VPN protocol (Recommended Protocol: OpenVPN)
  • Run the commands for DD-WRT or OpenWrt, whichever firmware type you have chosen while flashing your router’s firmware.

 Set Up Your VPN Server and Clients 

  • To start the process, configure your router’s firewall settings to allow inbound VPN connections.
  • Generate a certificate to ensure the communication of the VPN server with a secure channel to the VPN client.
  • Generate Private Keys and Certificates for the Profiling of VPN Clients.
  • Now install the software for OpenVPN.
  • At this point, complete the profiling process by issuing the certificates and private keys to VPN clients.
  • Set up the VPN client profiles on the devices that will access your VPN server.
  • VPN Clients with access can now connect to your VPN server.

Why Make Your Own VPN Server?

In today’s world of thousands of VPN providers offering great deals on VPN services, there are some additional advantages and reasons why you should have your own VPN server.

Save On The Monthly VPN Charges 

If you have your own VPN server, you can save all the dollars being deducted from your account on a monthly basis while getting all the benefits of a VPN. Although, you won’t be able to use the additional features which VPN services provide like Kill-Switch, Double Encryption, or Multi-Hop features.

 Access to Home Network from Anywhere 

Setting up your VPN on your own home router will allow you to use resources at home just as if you were still there. From printing documents from the printer in your house to accessing your personal files, anything that was available to you when connected via wireline connection will be accessible while using the VPN connection.

 Avoid Being Tracked 

You don’t want your web surfing activities to be monitored by a VPN service. Having your own VPN server will make sure your data is secure. Although, if you want a third-party VPN service that has strict log policies then you can go for ExpressVPN.

Why You Should Not Make Your Own VPN Server?

Setting up your own VPN server is not necessary. A reliable VPN service will provide you with a high level of security and privacy unless you have your own reasons to set up a VPN server for yourself.

Slow Internet Speed 

A VPN can have your back at all costs but it can also slow down your internet connection if you have an average speed bandwidth.

Home routers can be great assets for setting up a VPN server, but they don’t always have the necessary bandwidth. If you already have a limited speed internet then hosting your own VPN server will further slow down your internet speed.

Access to Your Home Network IP Only 

You won’t have access to multiple locations or servers which a commercial VPN provider offers to its users to try out and find the best VPN server which unlocks streaming libraries or geo-spoof your favorite geo-based AR games. But you will only have access to your home network’s IP address.

No Access to External VPN Features 

Commercial VPNs do not only offer secure internet activity on the web but they offer more features that can guarantee your online privacy. Features like Kill-switch, Double Encryption, or Multi-Hop features are usually included in the basic plans of third-party VPN services and these features are a plus to keep you secure and anonymous on the web!

Wrapping it up! 

Prioritize your reasons first if there really is a need for you to make a VPN server of your own. Because there is a requirement of extra effort if you set up a VPN server on your own with the limited resources you have – to keep maintaining it – to check for leaks and to configure it properly. Other than that, you can always get a trusted VPN service with reasonable pricing with a little research!

Have any thoughts on this? Let us know down below in the comments or carry the discussion over to our Twitter or Facebook.

Editors’ Recommendations:

Chris has been blogging since the early days of the internet. He primarily focuses on topics related to tech, business, marketing, and pretty much anything else that revolves around tech. When he's not writing, you can find him noodling around on a guitar or cooking up a mean storm for friends and family.

More in How-To