Free Website Hosting on AWS S3 for Static Sites |Video upload date:  · Duration: PT59S  · Language: EN

Host a static website on AWS S3 using the Amazon Free Tier and map a custom domain with DNS and optional CloudFront for HTTPS.

Step by step S3 static hosting with Route 53, CloudFront and HTTPS

Tired of paying for a web host that serves ads and regret? Host your static site on AWS S3 and treat the Free Tier like a free trial that never ends. This guide walks you through naming the bucket, uploading files, granting public read access without turning your data into public art, pointing DNS, and adding CloudFront for HTTPS when you decide to look professional.

Why S3 works so well for static sites

S3 is an object store that moonlights as a web server. It serves static HTML, CSS and assets directly from a website endpoint, with low cost bandwidth and decent performance. For small projects you will likely stay in the Free Tier, but keep an eye on requests and transfer unless you enjoy surprise invoices.

What you need

  • An AWS account with Free Tier available
  • A registered domain name
  • Route 53 or another DNS provider to change records
  • Optional CloudFront for HTTPS and edge caching
  • The AWS console or AWS CLI for uploads

Quick setup steps

  1. Create the bucket Use a bucket name that exactly matches your domain if you want root hosting, for example example.com. Choose the region closest to your visitors.
  2. Upload your site Use the console or run
    aws s3 sync ./site s3://example.com --acl public-read
    This copies HTML, CSS and images to S3.
  3. Make objects public Prefer a bucket policy over individual ACLs. Grant s3 GetObject for the objects in the bucket so browsers can fetch them.
  4. Enable static website hosting In the bucket properties set the index document to index.html and the error document to 404.html. Copy the website endpoint that AWS gives you.
  5. Point DNS In Route 53 create an alias record for the root domain pointing to the S3 website endpoint or add a CNAME for a subdomain. Root domains usually need an alias rather than a CNAME.
  6. Optional add HTTPS Use CloudFront in front of the bucket and request an ACM certificate in us east 1. CloudFront will serve the certificate so browsers do not complain about security.

Minimal bucket policy example

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

Tips and common gotchas

  • If you see 403 errors check the object permissions and the resource ARN in the policy.
  • For CloudFront request the ACM certificate in the us east 1 region even if your bucket lives elsewhere.
  • Enable gzip or precompress your assets to save bandwidth and speed up load times.
  • Monitor the Free Tier dashboard and set billing alerts so AWS does not ruin your day.

There you go. You now have a lean static site on S3 that costs almost nothing and performs better than many paid hosts. Use aws s3 sync to push updates, add CloudFront for HTTPS and caching when you need it, and enjoy the smug satisfaction of running a site on the cloud without selling a kidney.

I know how you can get Azure Certified, Google Cloud Certified and AWS Certified. It's a cool certification exam simulator site called certificationexams.pro. Check it out, and tell them Cameron sent ya!

This is a dedicated watch page for a single video.