Create a free Open VPN Server on Azure

bbhupen
4 min readMay 31, 2023

--

A VPN (Virtual Private Network) is required when you want to browse something more securely or if you want to browse something which is not available in your ip location, or also sometimes when you are behind a proxy. In this article, I will show you how you can set up a working openv VPN server on Microsoft Azure. Let’s get started.

Requirements

To get started with this tutorial, you need an Azure account. Don’t worry if you are a student you can get your free Azure account with $100 credits for 6 months. You can claim it by apply for Github Student Developer Pack.

Step 1:

Login to your Azure Account and naviagate to console. Search for virtual machine in the search bar.

Click on Create and select Azure Virtual Machine. On the next page select the subscription as “Azure for Students”. Fill up the necessary fields. Choose the region according to your choice, this option will determine the ip location of the VPN server that you are creating. And on the Image field select “See all images”.

This will open up the Marketplace page. Here Search for “OpenVPN Access Server”. Select the “OpenVPN Access Server — x64 Gen 1” from the drop down of OpenVPN Access Server.

Choose the machine size as “Standard_B1s-1vcpu, 1GiB memory” as this is the cheapest one. It only has 1 GB of memoey but this will get the job done. Before reviewing the changes, make sure generate a new keypair or use your existing one, as we will need this key to access the machine for initial setup. Download the key pair and save it on your system.

Click on ‘Review + create’, and once the validation is passed. Click on create. After the creation process is completed navigate to Virtual Machines, there you will see your vm listed. Click on it to expand. Find the public ip address and copy it.

Step 2:

Login to the machine using ssh. This will be the initital setup of the open-vpn server. Use the following command fromt your terminal to connect to the machine: ssh -i <key_pair_path> azureuser@<your_machine_ip>
You should see a license agreement terms, type yes and enter.

Next you will be asked how would you want to configure your vpn. You can change any value if you want or keep it on default. Then you will be asked if you want to login to the admin panel using user ‘openvpn’. Press enter and set your password. And also confirm password. After that it’ll ask for activation key, leave it blank. That’s it setup is done now lets connect to it.

Step 3:

Now navigate to https://<your_machine_ip>/admin , a privacy error will open up. Don’t worry just overide it and you should see this page.

Login using the credentials you created on the setup process and agree the terms and conditions. Now navigate to https://<your_machine_ip> . This is the user portal from where we can download the openvpn config file. You would see a similar login page as above.

Login using the same credentials. On a successful login you should the page above. If you don’t have the open-vpn client installed on you pc, download it from here. Click on Yourself(user-locked profile . This will download the config file. Import this file on the openvpn-client setup what’s required and you are good to go. Connect to it.

That’s it folks. Enjoy browsing through VPN.
Thanks for reading and stay safe 😃.

--

--

bbhupen
bbhupen

Written by bbhupen

Wannabe Backend Developer

Responses (1)