🌐

Setting Up Free VPN on AWS

Jan 19, 2025

Setting Up a Free VPN Server on AWS

Introduction

  • Purpose of a VPN: Protects internet activity from hackers.
  • Objective: Set up a free VPN on AWS without paying.

Prerequisites

  1. AWS Account: Sign up for a free AWS account.
  2. Coffee: Recommended for the process.

Steps to Set Up VPN Server

Logging into AWS

  • Website: Go to aws.amazon.com.
  • Login: Enter AWS console.

EC2 Instance Setup

  • Navigate to Services: Click on 'Services' -> 'EC2' under 'Compute'.
  • Launch Instance:
    • Click 'Launch instance'.
    • Select AMIs -> AWS Marketplace.
    • Search for OpenVPN in the search bar.
    • Choose the first option: Ubuntu server with OpenVPN (free tier eligible).

Selecting Instance Size

  • Choose Size: Select T2.micro (free tier eligible).
  • Review and Launch:
    • Click 'Review and launch'.
    • Hit 'Launch' again.

Key Pair Setup

  • Create Key Pair:
    • Choose 'Create a new pair'.
    • Name it (e.g., VPN server).
    • Download the key pair (.pem file).

Connecting to Instance

  • SSH Connection:
    • Right-click instance, select 'Connect'.
    • Use 'Standalone SSH' option.
    • Modify command for key location if necessary.
    • Run command in terminal or command prompt.

Initializing Server

  • Accept Default Settings: Enter yes to accept terms.
  • User Change: Reconnect as openvpn AS instead of root.

Configuring User Password

  • Password Setup:
    • Run sudo passwd openvpn.
    • Set and confirm a password.

Accessing Admin Panel

  • Public IP Address: Copy IPv4 Public IP from AWS.
  • Admin Page:
    • Open browser: https://<your-ip>:943/admin.
    • Proceed through security warning.
    • Login: Username openvpn, password set earlier.

Configuring VPN Settings

  • Route Internet Traffic:
    • Under 'VPN settings', enable "Yes, all client traffic should be routed through the VPN".
    • Save settings and update server.

Connecting Clients

  • User Portal Access:
    • Go to https://<your-ip>:943.
    • Login with openvpn and password.
    • Download client software for your OS (e.g., Windows).

Installing Client Software

  • Install Client:
    • Run downloaded installer.
    • Follow prompts to complete installation.

Testing VPN

  • Connect and Verify:
    • Use OpenVPN client to connect.
    • Verify IP address via Google what's my IP.

Additional Information

  • Mobile Setup: Use the OpenVPN app for iOS/Android.
  • 12-Month AWS Free Tier: Allows 750 hours of free usage/month.
  • Post-Free Period Cost: Around $10/month.

Conclusion

  • Benefits: Secure internet and potential AWS skills enhancement.
  • Further Learning: Consider AWS courses for career development.
  • Feedback: Try setting up and engage for feedback.