Setup a VPN Server Using OpenVPN on AWS
Storytime: When I was visiting Istanbul, there was an alleged terrorist attack and the Turkish government responded by restricting social media platforms. I was cut off from communication with my family back home in New York City. My solution was to launch a Virtual Private Network (VPN) on cloud infrastructure. VPNs are cybersecurity tools that encrypt your internet connection. It helps to protect your privacy and security when you’re online. I was able to call my mother on Whatsapp and let her know I was alright. Applying cybersecurity theory to real life saved me.
Follow the steps below to learn how to launch your own VPN on AWS.
-
Log into AWS. Launch and name an EC2 instance.
-
Select OpenVPN from AWS Marketplace AMI.
-
Select t2.micro, which has the Free tier eligible plan.
-
Create a new key pair (optional).
-
Create a username and password by connecting to the server.
-
After the terminal window opens, press ‘yes’ for the agreement. Continue pressing ‘enter’ to confirm all default settings. Enter password. No need to specify activation key, just hit ‘enter’.
-
You have successfully created a username and password!
-
Configure VPN settings in the admin panel by copying the Admin URL and entering it in a new tab in your internet browser. Press advanced and proceed to the site.
-
Enter the username and password you just created. Accept the license agreement once logged in.
-
Go to the VPN settings.
-
Scroll down to routing section and toggle ‘yes’ for ‘Should client Internet traffic be routed through the VPN?’.
-
Enable ‘yes’ for ‘Have clients use specific DNS servers’.
-
Enter Google for fast response and save settings.
-
Click ‘Update Running Server’. You will have successfully configured VPN settings!
-
Download and install the [OpenVPN app] (https://openvpn.net/client/) on your device.
-
To import profile, go back to terminal and paste the Client address.
-
Click ‘accept’.
-
Enter the username and password you set. You can also change the profile name if you prefer.
-
Click toggle and enter the password.
You should have a working VPN!
Note: To check and see if it is working, you can Google “What is my IP?”. It should match with your Public IP.