Free TLS with Caddy Web Server on AWS EC2 with Let's Encrypt
Overview

In this tutorial we will see how to deploy a static website on AWS EC2 using Caddy web server with automatic HTTPS certificates from Let's Encrypt.
What you'll build:
• Complete AWS infrastructure (VPC, subnet, security groups, EC2 instance)
• DNS configuration via Route 53
• Caddy web server with automatic HTTPS
• Static website accessible via custom subdomain
• Production ready setup with HTTP to HTTPS redirect
all in less than 10 min
How Stakpak Helps?
You don't need to know anything about networking, or AWS or Caddy to sit it up, you dont need to go through documentation or Google commands
Step-by-Step Guide
Prerequisites
Open your terminal and type "stakpak"
Cloud provider credentials configured
Then ask Stakpak to "install caddy on Ubuntu on EC2 "
It will start by checking the AWS creds and region

it will create
Internet Gateway
Attach Internet Gateway to VPC
Create a public subnet
Create a route table with an internet route
Create security group (ports 22, 80, 443)
Generate SSH key pair
Now it will create the EC2 instance
Now we drink coffee while the EC2 instance starts
Now it will set the DNS and install Caddy, and test it
Now it's working🥳

Extra Resources:
References
Last updated