AWS  

🌐 How to Host a Static Website on AWS Using S3, CloudFront, Route 53, and SSL

Introduction

If you have a static website (HTML, CSS, and JavaScript files) and want to host it online securely with your own domain, AWS offers an easy and reliable way to do it.
With just a few services β€” Amazon S3, CloudFront, Route 53, and AWS Certificate Manager (ACM) β€” you can host a website that is fast, secure, and scalable, without needing any server.

In this article, you’ll learn step by step how to make your static website live using AWS.

βš™οΈ Services You’ll Use

ServicePurpose
Amazon S3Stores your website files (HTML, CSS, JS)
CloudFrontMakes your website load fast everywhere
Route 53Connects your custom domain name
Certificate Manager (ACM)Adds HTTPS security (SSL certificate)

StormIT-HTTPS-Static-Website-1

πŸͺœ Step 1. Create an S3 Bucket

  1. Go to the S3 console β†’ click Create Bucket.

  2. Name your bucket the same as your domain (e.g., www.example.com).

  3. Uncheck Block all public access and confirm.

  4. Upload your website files (index.html, style.css, etc.).

Then go to Properties β†’ Static website hosting β†’

  • Choose β€œUse this bucket to host a website”

  • Set index document: index.html

Click Save β€” you’ll get a website endpoint like:

http://www.example.com.s3-website-us-east-1.amazonaws.com

πŸͺœ Step 2. Create a CloudFront Distribution

CloudFront helps your website load faster globally.

  1. Go to CloudFront β†’ click Create Distribution.

  2. In the Origin domain, select your S3 bucket (the website endpoint).

  3. Set Viewer Protocol Policy β†’ β€œRedirect HTTP to HTTPS.”

  4. Under Alternate Domain Names (CNAMEs), add your domain name.

  5. Choose Request or import a certificate from ACM (for HTTPS).

Click Create Distribution and note down the CloudFront URL, e.g.:

d123abc.cloudfront.net

πŸͺœ Step 3. Request an SSL Certificate (HTTPS)

  1. Open AWS Certificate Manager (ACM).

  2. Click Request a public certificate.

  3. Add your domain name (e.g., example.com and www.example.com).

  4. Choose DNS validation.

  5. ACM will give you a CNAME record to add in Route 53.

  6. Wait until the status shows β€œIssued”.

πŸͺœ Step 4. Configure Route 53 (Domain Name)

  1. Go to Route 53 β†’ Hosted Zones β†’ open your domain.

  2. Add a new A Record (Alias):

    • Type: A – IPv4

    • Alias: Yes

    • Target: Select your CloudFront distribution

  3. Save the record.

This connects your domain to CloudFront β†’ S3.

πŸͺœ Step 5. Test Your Website

After 10–30 minutes (DNS propagation), open your browser and go to:

https://www.example.com

βœ… You should see your website live
βœ… It loads fast globally
βœ… It has a secure HTTPS lock icon

πŸ’° Cost Summary (Approximate)

ServiceCost
S3$0.50/month
CloudFront$1–3/month
Route 53$1/month
ACMFree

πŸ’‘ Total: Usually under $5 per month for small websites.

🧠 Why This Setup is Great

  • 🌍 Fast β€” CloudFront caches your site worldwide

  • πŸ”’ Secure β€” Free SSL certificate

  • βš™οΈ Scalable β€” No servers to manage

  • πŸ’Έ Cheap β€” Pay only for what you use

  • 🧘 Simple β€” Perfect for portfolios, landing pages, or blogs

🎯 Conclusion

Hosting a static website on AWS is simple, powerful, and affordable.
With just S3, CloudFront, Route 53, and ACM, you get a fully serverless, secure, and globally available website.

This is one of the best ways to start learning AWS β€” and it’s a skill every cloud developer should know.