Hosting a Static Website on AWS using S3 and CloudFront โ€“ Step by Step Guide.

Mohit DeoreMohit Deore
1 min read

๐Ÿ” Introduction

When I first wanted to host a simple static website, I realized AWS offers a powerful yet cost-effective solution using S3 + CloudFront.
In this blog, Iโ€™ll show you exactly how I set up my first AWS project, step by step.

๐Ÿ— Architecture Diagram

  • S3 โ†’ stores website files.

  • CloudFront โ†’ delivers content globally via CDN.

โš™๏ธ Step-by-Step Implementation

1. Create an S3 Bucket

  • Open S3 console

  • Create bucket โ†’ mywebsite-bucket

  • Enable static website hosting

2. Upload Website Files

  • Upload your index.html and any assets

  • Set correct permissions (use bucket policy for public read)

3. Add CloudFront

  • Go to CloudFront โ†’ Create distribution

  • Origin = your S3 bucket

  • Enable caching & HTTPS

4. (Optional) Use Route 53 for Domain

  • Buy or connect your domain

  • Point DNS to CloudFront distribution

๐Ÿ” Security & Best Practices

  • Avoid making S3 bucket fully public โ€“ use CloudFront for access

  • Enable HTTPS (TLS certificate via ACM)

  • Monitor usage in CloudWatch

๐Ÿš€ Final Output

โœ… Conclusion

Hosting a static website on AWS is simple once you understand the flow. With just S3 + CloudFront, you can make your project available to the world at very low cost.

1
Subscribe to my newsletter

Read articles from Mohit Deore directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Mohit Deore
Mohit Deore