AWS Builder Center

How to Host a Static Website on Amazon S3: A Beginner-Friendly Guide

Learn how to easily migrate and host a static website using Amazon S3, manage public access permissions, and configure custom error documents.

Hosting static websites on cloud infrastructure shouldn't be complex. Using Amazon S3, you can serve HTML, CSS, JavaScript, and media files directly without managing any server instances.
  • Step 1: Locate or Create Your S3 Bucket Navigate to the Amazon S3 Console and select your designated website bucket. Ensure your bucket contains all core web assets ( index.html , CSS, and media files).
  • Step 2: Configure Public Access Settings By default, S3 blocks all public traffic. To make your site accessible:
  1. Go to the Permissions tab of your bucket.
  1. Uncheck Block all public access and save changes.
  • Step 3: Attach Bucket Policy Add a JSON policy under Permissions > Bucket policy to allow public read access:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::YOUR-BUCKET-NAME/*"
}
]
}
  • 
  • Step 4: Enable Static Website Hosting
  1. Navigate to the Properties tab.
  1. Scroll to Static website hosting and click Edit.
  1. Select Enable and set the index document to  index.html  (and optionally set an error document like  error.html ).
  • Step 5: Test Your Website Endpoint Copy the generated Bucket website endpoint URL from the Properties tab and open it in a browser to confirm your static site is live!
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article