Deploy your own OpenVPN Server on AWS

Overview

Most of your AWS resources should be in private subnets for security reasons, but that also means they’re not directly accessible from the internet. To reach them securely, you need a VPN.

In this tutorial, we’ll use OpenVPN on AWS to create a secure, encrypted connection to your private resources so your team can access them safely.

Problem

  • AWS resources in private subnets aren’t accessible from the internet by default.

  • Teams often try to solve this by opening ports or using bastion hosts, which increases security risks.

  • These workarounds also add complexity to network management and access control.

  • A VPN is needed to provide secure and simple access without exposing services publicly.

Business Impact

Without a VPN, secure remote access is harder, slower, and more risky. A VPN simplifies access and keeps development and operations running securly.

But what is a VPN?

A VPN (Virtual Private Network) is a secure, encrypted connection that allows you to access a private network over the internet as if you were physically inside it. It’s commonly used to safely reach internal servers, databases, or applications without exposing them to the public.

How Stakpak Helps?

It lets you selfhost OpenVPN with zero AWS and Open VPN experience you dont need to read docs or google commands

Step-by-Step Guide

Prerequisites

  1. Cloud provider credentials configured

  2. Then just ask it to i want to install openvpn on aws so i can access my private resources

  3. Here you chose your preferences

  1. I want to know more about the different architectures, so let's ask about it

  1. Here I chose

    1. Which AWS Region? EU West 1

    2. Do you have a VPC set ups? Yeah, i have a VPC

    3. How many people need VPN Access? Just one person needs access

    4. AWS Client VPN or Self Hosted Open VPN or Open VPN from Market Place? Self Hosted Open VPN

  1. I will just tell it to continue with the defaults

  1. Now we can review the commands and press Enter to continue it will be:

    1. Get the VPC details

    2. Get the subnet details

    3. Check the internet gateway

  2. Now it will create a security group for open vpn and get the latest Ubuntu version

  1. Now it will create the security group rules, SSH key, and launch the ec2 instance

  1. Now that we have the EC2 ready, Stakpak will start setting up open VPN

  1. That's it, now we can use OpenVPN

Extra Resources:

References

Last updated