Step-by-Step Guide: How to Create Your Own Free VPN Server on AWS

Step-by-Step Guide: How to Create Your Own Free VPN Server on AWS

An Overview

             A VPN, or Virtual Private Network, creates a secure and encrypted tunnel to the VPN server. It utilizes both client and server applications, allowing users to send and receive data as if their device were directly connected to a private network.

OpenVPN uses a combination of SSL/TLS for key exchange and AES encryption to secure data transmission. It works on multiple platforms and is available on most operating systems, including macOS, Linux, iOS, and Android. OpenVPN helps mask a user’s real IP address, providing anonymity when browsing the internet or accessing sensitive data.

How OpenVPN Works.

Screenshot 2024 10 01 124840

In this guide, I’ll show you how to connect an Android mobile device to a VPN server on EC2. This configuration will enable you to use the internet securely from your phone, even when connected to an untrusted network. Let’s get started!

STEP 1: Setting up open VPN server

Login to your management console, navigate to the EC2 Dashboard and then click “Launch instance”.

Screenshot 2024 09 23 211632

Choose on “AWS Marketplace” and type Open VPN. Select the first option with the free tier eligible tag.

Screenshot 2024 09 23 213154

On the next page click “Subscribe on instance launch” and select the t2micro which contain the free tire eligible tag.

Screenshot 2024 09 23 221720
Screenshot 2024 09 23 221529

Create a new keypair and download the keypair.

Screenshot 2024 09 23 222223

Then click on Launch Instance and wait for the instance to go to running state.

Screenshot 2024 09 23 222616

STEP 2: Server Configuration.

Open your terminal and SSH to your  server as a root user in order to configure the admin side of VPN, to do that use the command below.

ssh -i "{keyname}.pem" openvpnas@{Your-IPv4-Public-IP}

Type yes for these 2 prompts want to configure your VPN.

Should client traffic be routed by default through the VPN?

> Press ENTER for default [no]: yes, should client DNS traffic be routed by default through the VPN?
> Press ENTER for default [no]: yes.

Screenshot 2024 09 24 063109
Screenshot 2024 09 24 202747

Upon you reaching the end, Change the user password. Enter a new password twice and you’re good to go.

sudo passwd openvpn

Copy the public DNS and IP address for your instance and paste the following on your browser.

https://your IP address:943/admin.

image 3

You see this following page.

Screenshot 2024 09 24 205835

If successful, you will be asked to accept the agreement and they would be seeing this page. On left page go to configuration and click on the VPN setting.

Screenshot 2024 09 24 210137

Scroll down and apply the following changes:

Make sure the toggle for the should client internet traffic be routed through the VPN? Yes

Change the toggle for her clients use specific DNS server to yes.

Primary DNS server   1.1.1.1

Secondary DNS server 8.8.8.8

Screenshot 2024 09 24 212344

You change the setting, and you’ll need to update the server, so click on “Update Running Server”.

To obtain the official open VPN connect app. Install the official OpenVPN connect app on your android device, and the open it.

Screenshot 20240924 214722 Open VPN Connect 1 1

Start the import process by entering the public Ip address of your running EC2.

Next you type the username and the password.

image
image 1

You’re all set! Time to explore the app.

image 2

Conclusion

Congratulations! You’ve successfully set up your own free VPN server on AWS. Now, you can enjoy a secure and private browsing experience with complete peace of mind. Happy surfing!

Tags: No tags

Add a Comment

Your email address will not be published. Required fields are marked *