🌐 Day 22: Static Website Hosting on S3 – Host Websites the Easy Way
Category: AWS Storage / Web Hosting
Goal: Learn how to host a basic website using only Amazon S3
🧠 What You’ll Learn Today:
- What is Static Website Hosting
- How S3 can serve websites
- Steps to host HTML/CSS on S3
- Real-world use cases and tips
🌍 1. What Is Static Website Hosting?
A static website is a site made with only HTML, CSS, and JavaScript, with no backend logic or database.
Amazon S3 allows you to host these websites without managing any server.
✅ Fast
✅ Cheap
✅ Scalable
✅ No maintenance required
🪣 2. How Does S3 Host a Website?
Amazon S3 can serve website content when:
- You upload static files (like
index.html
,style.css
) - Enable the static website hosting feature
- Set the correct permissions to allow public access
It gives you a public URL to access the site.
🛠️ 3. Step-by-Step Guide
Step 1: Create an S3 bucket
→ Use the same name as your domain (optional but useful)
Step 2: Upload your website files
→ Include index.html
and any CSS/JS/images
Step 3: Enable static website hosting
→ Go to Properties > Static Website Hosting
→ Enable it and define index.html
as the home page
Step 4: Make your objects public
→ Add a bucket policy to allow public access
→ Example policy allows read-only access to everyone
Step 5: Access your website
→ Use the S3 website endpoint provided by AWS
💡 Optional: Custom Domain + HTTPS
Use Route 53 to point your domain to your S3 website.
Add CloudFront to enable HTTPS and faster global delivery.
✅ 4. Use Cases
- Personal portfolio websites
- Static blogs
- Company info pages
- Resume websites
- Event or landing pages
🧠 End of the Day Notes:
💡 Hosting a static website on S3 is beginner-friendly and cost-effective.
🛠️ You don’t need to manage servers – just upload files and go live.
🌐 For better security and performance, pair with CloudFront and Route 53.
🔁 Navigate the Series:
⬅️ Day 21: S3 Lifecycle Policies – Automate Data Management in AWS
➡️Day 23: Intro to CloudFormation – Automate Your AWS Setup