AWS EC2 VPN Server Setup: Quick Start Guide
How to launch the AWS Marketplace appliance for Access Server and get your VPN server up and running in minutes.
OpenVPN Access Server is available as a bring-your-own-license (BYOL) offering in AWS Marketplace. You can deploy Access Server in your own Amazon Virtual Private Cloud (VPC) and activate it with an Access Server subscription.
This guide walks you through the recommended AWS BYOL Marketplace offering with AWS CloudFormation, which is the recommended deployment method for new installations.
The AWS Marketplace BYOL offering also supports the traditional Amazon EC2 launch method. That method requires SSH access and completing the initial Access Server configuration from the command line. For new deployments, we recommend using AWS CloudFormation.
Note
The AWS CloudFormation deployment method documented here is part of the AWS Marketplace BYOL offering.
Deploying Access Server on AWS is well suited for organizations that need to:
Give remote users secure access to applications and private networks in AWS.
Connect cloud and on-premises networks with site-to-site VPN connections.
Run a self-managed VPN server within their AWS environment.
Note
For sizing and performance guidance, refer to System Requirements.
π Choose the AWS BYOL offering
The Access Server Hub provides several ways to deploy Access Server on AWS, including AWS Launcher, CloudFormation Script, Linux on AWS, Docker on AWS, and AWS Marketplace.
For this guide, use the AWS Marketplace BYOL offering.
Sign in to the Access Server Hub.
From the Installation page, select AWS Marketplace.
Under Amazon Machine Image, select the BYOL offering.
Select Launch from AWS Marketplace.
Sign in to AWS if prompted.
π About BYOL subscriptions
The AWS BYOL offering doesn't include a paid Access Server subscription with the AWS infrastructure charges. Activate the deployed server with a subscription from OpenVPN.
You can:
Use a free subscription for two VPN connections.
Start a trial.
Purchase a subscription for the number of VPN connections your deployment requires.
Use an existing Access Server subscription.
Your AWS infrastructure charges are billed separately through AWS.
π Subscribe to the AWS Marketplace BYOL offering
AWS Marketplace defaults to the Amazon Machine Image deployment option. To use the recommended CloudFormation deployment, select the CloudFormation template before subscribing.
On the AWS Marketplace product page, select View purchase options.
Review:
Product details.
Offer summary.
Total cost.
Terms and conditions.
Purchase details.
Select Subscribe.
Wait while AWS processes the subscription request.
Don't close or refresh the page while the request is processing.
When AWS confirms that you've subscribed to OpenVPN Access Server (BYOL), select Launch your software.
Note
AWS infrastructure charges for the EC2 instance and related resources will apply, and Access Server requires an OpenVPN subscription for VPN connections above two.
From the AWS Marketplace launch page, choose the recommended CloudFormation deployment.
For the deployment method, select AWS CloudFormation instead of Amazon EC2.
Select the Access Server version.
The latest available version is selected by default.
Select the AWS Region where you want to deploy Access Server.
Select Launch with CloudFormation.
AWS opens the CloudFormation Create stack workflow.
βοΈ Create the CloudFormation stack
Specify the template
For Prepare template, keep Choose an existing template.
Under Specify template, keep Amazon S3 URL selected.
AWS Marketplace automatically populates the template URL.
Select Next.
Configure stack details
Enter a Stack name.
Configure the Access Server deployment parameters:
Configuration
Details
Activation key
Paste the activation key from the OpenVPN subscription you want to use with this Access Server deployment, or leave this blank to do at a later step.
Let's Encrypt Certificate
Select Enabled to automatically configure a browser-trusted Let's Encrypt certificate for the Admin Web UI and Client Web UI. Select Disabled if you plan to manage the web SSL certificate separately. Access Server will launch with a self-signed certificate.
VPC ID
Select the Amazon VPC where Access Server should be deployed.
Public Subnet ID
Select the public subnet for the Access Server instance.
SSH Access CIDR
Specify the CIDR block allowed to reach the instance over SSH on TCP port 22. Use a specific address such as
198.51.100.10/32whenever possible.Security recommendation
Avoid allowing SSH from
0.0.0.0/0for production deployments. We recommend you restrict access to a specific administrator IP address or trusted network.Instance name
Enter a descriptive name for the Access Server EC2 instance.
Instance type
Select an EC2 instance type appropriate for your VPN workload. Refer to System Requirements for sizing guidance.
AMI ID
Keep the AMI ID automatically populated by AWS Marketplace.
EC2 KeyPair for SSH access
Recommended. Enter the name of an existing EC2 key pair if you want SSH access to the instance. You can find available key pairs under EC2 β Network & Security β Key Pairs. If you leave this blank, CloudFormation will auto-generate an EC2 key pair.
Admin password
Optional. Enter an initial password for the
openvpnadministrative account. Leave the field blank to have CloudFormation generate a temporary password automatically.Select Next.
π‘οΈ Configure permissions and stack options
Under Permissions, optionally assign an existing AWS IAM service role that CloudFormation can assume or create a new role.
Configure any additional stack deployment options, validations, or settings required for your environment.
Acknowledge that AWS CloudFormation may create IAM resources.
Select Next.
π Review and create the stack
Review the stack configuration.
Confirm the parameters are correct.
Select Submit.
AWS begins creating the CloudFormation stack.
Tip
If you regularly deploy Access Server with the same configuration, you can use the CloudFormation quick-create option to streamline future deployments.
π΅οΈββοΈ Monitor the deployment
The CloudFormation stack displays the deployment timeline and the AWS resources created for Access Server.
Monitor the stack status while AWS creates the resources.
Wait until the stack reports:
CREATE_COMPLETE.Select the Outputs tab.
π Get the Admin Web UI credentials
The CloudFormation outputs provide the information needed for your initial Access Server sign-in.
Locate:
Output
Description
AdminPortal
The URL for the Access Server Admin Web UI. The initial URL uses the public IP address of the deployed instance.
TempPassword
The temporary password for the
openvpnadministrative account when you leave the Admin password parameter blank.Important
After the CloudFormation stack reaches
CREATE_COMPLETE, Access Server may require up to five additional minutes to finish system initialization. Sign-in attempts can fail during this period.Copy the TempPassword, if CloudFormation generated one, and store it securely.
Select the link for the AdminPortal URL.
After selecting the AdminPortal URL in a browser, the Admin Web UI login page displays.
Sign in with the
openvpnadministrative account and the TempPassword or the password you configured during deployment.Review the End User License Agreement (EULA).
Select Agree.
The Activate your Access Server page displays unless you entered an activation key with the stack details; then skip to the next section.
Open the Access Server Hub in another browser tab or window.
Select Subscriptions.
To create a free subscription for this deployment:
Select Purchase a New Key.
Select Free.
Select the Copy icon for the new activation key.
Return to the Admin Web UI.
Paste the activation key into the activation field.
Select Activate.
Access Server activates the subscription and unlocks the VPN connections included with it.
Tip
If you already have an Access Server subscription that you want to use for this deployment, copy its activation key instead of creating a new free subscription.
The onboarding wizard displays the first time you sign in after activation. It guides you through the initial access configuration and helps you test your first VPN connection.
Select whether VPN clients should have:
Internet access through Access Server.
Access to private resources in your AWS environment.
Both, if appropriate for your deployment.
If access to private resources is enabled, review the network CIDRs that Access Server detected.
Verify that the detected networks match the AWS VPC networks users should access.
Keep only the networks that VPN users should be allowed to access.
Select Continue.
Review the OpenVPN Connect download offered by the wizard.
The wizard displays the download appropriate for the operating system of the device you're currently using.
Select Download.
Install OpenVPN Connect.
Return to the onboarding wizard.
Select Continue.
The wizard displays a prompt while it waits for a VPN connection.
Launch OpenVPN Connect on your device.
Connect using the profile included.
Confirm that the VPN connection succeeds.
Return to the Admin Web UI.
Select Finish Wizard.
Tip
You can also close the onboarding wizard by selecting the X if you prefer to skip these steps.
After completing the wizard, the Admin Web UI opens and presents a short product tour covering:
The Client Web UI
Users
Access Controls
Authentication
Activation
The AWS Marketplace BYOL offering also provides an Amazon EC2 deployment method.
This is the traditional Access Server AWS Marketplace workflow. It requires:
Selecting or creating an EC2 SSH key pair.
Connecting to the instance with SSH.
Completing the Access Server initial configuration from the command line.
Configuring the Let's Encrypt certificate during the command-line setup.
Signing in to the Admin Web UI after initialization completes.
We recommend the AWS CloudFormation method for new deployments.
Configure Let's Encrypt during EC2 setup
During the initial command-line configuration, Access Server asks whether you want to configure a Let's Encrypt certificate.
When prompted, enter y.
Access Server requests and configures a browser-trusted Let's Encrypt certificate for the Admin Web UI and Client Web UI.
If you don't configure Let's Encrypt, Access Server uses its default self-signed certificate. The web connection remains encrypted, but browsers will display a certificate warning because they can't automatically verify the server's identity.
After the command-line configuration completes, record the Admin Web UI URL and administrative credentials, sign in, activate Access Server, and complete the onboarding wizard.
If your VPN setup consists of a site-to-site connection between your cloud instances and your on-premises machines, ensure you disable source/destination check protection on Amazon; otherwise, routing wonβt function properly.
Turn off source/destination checks:
From Instances in the EC2 console, right-click on the VPN instance ID.
Select Networking β Change source/destination check.
Check Stop under Source / Destination checking and select Save.
Source/destination checking can also block traffic if you want VPC data to go directly to the IP addresses of your VPN clients in the VPN client subnet. For that use case, turn off the check as well.
Access Serverβs default routing uses network address translation (NAT). Traffic originating from the VPN clients appears to come from the local IP address of Access Server with NAT, and this is simpler than setting up routing.
However, when using NAT, traffic from the VPC itself canβt directly access a VPN client because the NAT engine prevents direct contact. You must configure routing instead of NAT to allow direct access to a VPN client.
To access this configuration:
Sign in to the Admin Web UI.
Navigate to Access Controls β Global Access Rules.
Set IP Addresses and Subnets to Route for Reachable via.
Configure your subnets for your network.
After setting up routing, the source IP address of packets coming from the VPN clients is kept intact, and direct access from the VPC network to the VPN client subnet is possible. However, because the VPC doesnβt automatically recognize the VPN subnet within the VPN instance, it doesnβt know how to send the return traffic back to the instance. To correct this problem, add a static route in the Amazon routing table for your VPC so that the return traffic flows properly. Refer to Amazonβs AWS VPC routing documentation:Β Route tables for your VPC (Amazon).
When you launch a BYOL EC2 instance from the AWS Marketplace, you can pass user data to perform automated configuration tasks during deployment. You can use this feature to preconfigure Access Server with specific settings, such as administrative credentials.
User data is supported when launching instances manually from the EC2 dashboard, or via the AWS API or CLI.
Tip
If you deploy from the Access Server Portal, user data isn't exposed directly. To use it, download the CloudFormation (CF) template, modify it to include your user data, and deploy it manually using AWS CloudFormation Stacks.
Hereβs an example of user data sent during launch:
Send a username and password for your administrative user. When you do this, you donβt need to SSH in to finish the setup wizard. Youβve already set your account credentials.
Entering user data:
During the instance launch, select Advanced details to expand that section.
Scroll down to the text field,Β User data.
Enter your data for one or more of the available settings below. Ensure you enter each row asΒ key1=value1, and donβt use quote keys or spaces on either side of the equal character. Example:
public_hostname=vpn.example.com admin_user=admin1 admin_pw=p@$w0rd
Available settings for pre-configuration with Access Server:
Key | Description |
|---|---|
public_hostname | The hostname used by clients to contact the server. |
admin_pw | The administrative account initial password. WarningThis parameter is communicated to the instance via cleartext channel. |
license | The Access Server license key. TipWithout a license key, Access Server allows up to two concurrent connections. |
reroute_gw (boolean, default=0) | If 1, clients route internet traffic through the VPN. |
reroute_dns (boolean, default=0) | If 1, clients route DNS queries through the VPN. Note: If the VPC CIDR block is defined, it is made accessible to VPN clients via NAT. |
