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
Note: Stakpak is open source, vendor neutral, and works with any model you choose.
Step by Step Guide
Prerequisites
Open your terminal and type "stakpak"
Cloud provider credentials configured
Turorial
Then ask Stakpak to
install caddy on Ubuntu on EC2It 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🥳




Top comments (0)