Simple Enough Blog logo
  • Home 
  • Projects 
  • Tags 

  •  Language
    • English
    • FranΓ§ais
  1.   Blogs
  1. Home
  2. Blogs
  3. How to Host a Static Website for Free with AWS S3

How to Host a Static Website for Free with AWS S3

Posted on September 30, 2025 • 5 min read • 956 words
Aws   S3   Helene  
Aws   S3   Helene  
Share via
Simple Enough Blog
Link copied to clipboard

A guide to hosting a static website for free using AWS S3.

On this page
I. Why Choose AWS S3 to Host a Static Website for Free?   II. Prerequisites and Initial Setup   1. Create a Bucket   2. Disable Public Access Restrictions   3. Add a Public Access Policy   III. Deployment and Hosting Setup: Step by Step   1. Prepare Your Site Files   2. Upload Files to S3   A. Via the AWS Web Console:   B. Via AWS CLI:   3. Enable Static Website Hosting   4. Test the Website   5. Add a Custom 404 Page (Optional)   IV. Advanced Options: CloudFront, Custom Domain, and Security   A. Add a Custom Domain   B. Improve Performance with CloudFront   C. Comparison Table   V. What Happens After the Free Tier?   A. Standard Pricing (post-Free Tier)   Amazon S3 (Static Site Hosting)   Amazon CloudFront (CDN + HTTPS)   Route 53 (Custom Domain)   B. Example: Static Blog – 100 MB & 5,000 Visits/Month   Tip: Set Up AWS Budgets   VI. Use Cases and Benefits   VII. Conclusion   πŸ”— Useful Resources  
How to Host a Static Website for Free with AWS S3
Photo by Helene Hemmerter

I. Why Choose AWS S3 to Host a Static Website for Free?  

  • Amazon S3 allows hosting of fully static websites (HTML, CSS, JavaScript).
  • With the AWS Free Tier, a small site can stay free for 12 months (up to 5 GB of storage, 20,000 GET requests & 2,000 PUT requests per month).
  • Highly resilient, scalable, and serverless, S3 provides 99.999999999% durability and handles traffic spikes effortlessly.
  • For HTTPS and custom domains, Amazon recommends using Amazon CloudFront + Route 53.

II. Prerequisites and Initial Setup  

  • Create a bucket
  • Disable public access restrictions
  • Add a public access policy

Before deploying a static site with S3, basic configuration is required. Here’s the step-by-step setup:


1. Create a Bucket  

  • In the AWS console, go to Amazon S3 and click Create bucket.
  • Name the bucket exactly like your domain (e.g., example.com) to use it with a custom domain.
  • Choose a region close to your users.

2. Disable Public Access Restrictions  

  • By default, new buckets block public access. In the Permissions tab, edit Block Public Access and disable the options.

3. Add a Public Access Policy  

Add the following policy in Bucket Policy:

{
  "Version":"2012-10-17",
  "Statement":[
    {
      "Sid":"PublicReadGetObject",
      "Effect":"Allow",
      "Principal":"*",
      "Action":["s3:GetObject"],
      "Resource":["arn:aws:s3:::YOUR_BUCKET_NAME/*"]
    }
  ]
}

Replace YOUR_BUCKET_NAME with the actual name of your bucket.


III. Deployment and Hosting Setup: Step by Step  

  • Prepare your site files
  • Upload files to S3
  • Enable static website hosting
  • Test the website
  • Add a custom 404 page (optional)

Once your S3 bucket is properly configured, it’s time to upload your static website and enable the hosting feature. Here are the detailed steps to get your site online in just a few minutes.


1. Prepare Your Site Files  

Create a simple structure like:

my-site/
β”œβ”€β”€ index.html
β”œβ”€β”€ style.css
β”œβ”€β”€ script.js
└── img/
    └── logo.png

The index.html file is required.
Make sure all relative paths in your HTML are correct.


2. Upload Files to S3  

Two methods:

A. Via the AWS Web Console:  

  1. Open your bucket in S3.
  2. Click Upload > Add files and select your site files.
  3. Click Upload (default options are fine if public access is enabled).

B. Via AWS CLI:  

If AWS CLI is installed and configured:

aws s3 cp ./my-site/ s3://BUCKET_NAME/ --recursive

Replace BUCKET_NAME with your actual bucket name. The –recursive option is essential to upload the entire folder.


3. Enable Static Website Hosting  

  1. Open the Properties tab of your bucket in AWS.
  2. Find the Static website hosting section.
  3. Click Edit > check Use this bucket to host a website.
  4. Enter:
    • Index document: index.html
    • Error document (optional): 404.html
  5. Save changes.

An endpoint URL like http://BUCKET_NAME.s3-website-REGION.amazonaws.com will be generated.


4. Test the Website  

Open the generated URL in your browser.
You should see your index.html.

If it doesn’t work:

  • Check that files were uploaded correctly.
  • Make sure the bucket policy allows public read access.
  • Check the permissions using the Permissions > Bucket policy button.

5. Add a Custom 404 Page (Optional)  

Create a 404.html file and place it at the root of your project.

Minimal example:

<!DOCTYPE html>
<html>
<head><title>Page Not Found</title></head>
<body>
  <h1>404 – Page Not Found</h1>
</body>
</html>

Specify this file in the Error document setting so S3 can display it for invalid URLs.


πŸ“Œ Note: the generated URL uses HTTP only. To enable HTTPS, configure CloudFront with an SSL certificate.


IV. Advanced Options: CloudFront, Custom Domain, and Security  

A. Add a Custom Domain  

  • Create a Hosted Zone in Route 53.
  • Add an A Alias record pointing to the bucket or CloudFront.

B. Improve Performance with CloudFront  

  • Create a CloudFront distribution.
  • Enable Origin Access Control (OAC) to restrict bucket access.
  • Use ACM certificate for HTTPS.

C. Comparison Table  

FeatureS3 OnlyS3 + CloudFront + Route 53
HTTPS❌ Noβœ… Yes
Custom Domain❌ Limitedβœ… Full with Route 53
CDN (Caching)❌ Noβœ… Yes
Estimated Cost (Post-Free)βœ… ~$0–0.50/monthβœ… ~$1/month

V. What Happens After the Free Tier?  

When the 12-month AWS Free Tier period ends, the resources you use are billed at the standard service rates. This does not disable your site, but it can lead to monthly charges if you continue using Amazon S3, CloudFront, or Route 53.

A. Standard Pricing (post-Free Tier)  

Amazon S3 (Static Site Hosting)  

ResourcePrice (us-east-1)
Standard Storage~$0.023 USD/GB/month
GET Requests~$0.0004 per 1,000 requests
PUT/COPY/POST~$0.005 per 1,000 requests

Amazon CloudFront (CDN + HTTPS)  

ResourcePrice
Data Transfer Out~$0.085 USD/GB
HTTP/HTTPS Requests~$0.0075 per 10,000 reqs

Route 53 (Custom Domain)  

ResourcePrice
Hosted Zone DNS~$0.50/month
DNS RecordsFree (up to 10,000)
Domain Name (optional)~$12/year

B. Example: Static Blog – 100 MB & 5,000 Visits/Month  

Assumptions:

  • Total site size: 100 MB
  • Monthly traffic: ~500 MB to 1 GB
  • 5,000 GET requests, 0 PUTs

Estimated Monthly Cost:

ServiceCost Estimate
S3 Storage$0.0023
S3 Requests~$0.002
CloudFront~$0.10–0.20
Route 53$0.50 (if custom DNS)
Total~$0.60 to $0.75

Static sites remain very inexpensive, even post-Free Tier, especially at moderate traffic levels.


Tip: Set Up AWS Budgets  

Use AWS Budgets to get alerts if your usage exceeds thresholds:

πŸ‘‰ https://console.aws.amazon.com/billing/home#/budgets

This helps you keep costs under control even after the Free Tier expires.


VI. Use Cases and Benefits  

  • Personal portfolio
  • Static documentation
  • Landing page
  • Generated blog (Hugo, Jekyll, etc.)

VII. Conclusion  

Amazon S3 offers a reliable and low-cost solution for hosting static sites. With no server maintenance and high durability, it’s perfect for modern web projects. Paired with CloudFront and Route 53, you get global delivery, HTTPS, and custom domains at minimal cost.


πŸ”— Useful Resources  

  • AWS S3 Website Hosting Docs
  • AWS Free Tier – S3 Details
  • Route 53 – Custom Domains
  • Using CloudFront with S3
 The Basics of SEO: How Search Engines Work
How to Host a Static Website for Free with GitHub Pages 
  • I. Why Choose AWS S3 to Host a Static Website for Free?  
  • II. Prerequisites and Initial Setup  
  • III. Deployment and Hosting Setup: Step by Step  
  • IV. Advanced Options: CloudFront, Custom Domain, and Security  
  • V. What Happens After the Free Tier?  
  • VI. Use Cases and Benefits  
  • VII. Conclusion  
  • πŸ”— Useful Resources  
Follow us

We work with you!

   
Copyright Β© 2026 Simple Enough Blog All rights reserved. | Powered by Hinode.
Simple Enough Blog
Code copied to clipboard