Amazon S3 (Simple Storage Service) lets you host static websites. Static websites are made up of HTML, CSS, JavaScript, and media files — no server-side code is needed.
This guide will walk you through the steps to set up and publish a static website using an S3 bucket.
Step 1: Create an S3 Bucket
Go to the S3 Console in AWS.
Click Create bucket.
Enter a unique name for your bucket. For website hosting, the bucket name should match your domain name (e.g., example.com).
Choose a region.
Uncheck Block all public access (you'll make the bucket public for web access).
Acknowledge the warning and click Create bucket.
Step 2: Upload Your Website Files
Open your new bucket.
Click Upload.
Add your HTML, CSS, JS, and other static files.
Click Upload.
Step 3: Set Permissions to Make Files Public
You need to make your files publicly readable:
Go to the
Permissions tab
.
Scroll to
Bucket Policy
.
Add a policy like this:
{ "Version" : "2012-10-17" , "Statement" : [ { "Sid" : "PublicReadGetObject" ,…