Hosting a Static Website on AWS S3
Hosting a static website on AWS S3 is a cost-effective and scalable solution. This guide walks you through setting up your own static site with just a few steps.
Step 1: Clone My Git Repo
Grab the sample files from my GitHub:
git clone https://github.com/malcolmso/aws
Step 2: Create an S3 Bucket
- Log in to your AWS Console.
- Navigate to S3 and click “Create Bucket.”
- Provide a unique bucket name.
- Select a region and adjust settings as needed.
- Click “Create Bucket.”
Step 3: Upload Your HTML Files
- Open the bucket.
- Click “Upload” and add
index.html
anderror.html
. - Click “Upload” to confirm.

Step 4: Enable Static Website Hosting
- Go to the Properties tab of your bucket.
- Scroll to Static Website Hosting → Edit.
- Enable hosting and set:
Index Document: index.html
Error Document: error.html
Click “Save.” Then note your bucket endpoint:
http://your-bucket-name.s3-website-us-east-1.amazonaws.com/
Step 5: Update Bucket Permissions
- Go to Permissions → Bucket Policy → Edit.
- Copy your Bucket ARN:
arn:aws:s3:::your-bucket-name
Use the AWS Policy Generator to build a public-read policy:
- Policy Type: S3 Bucket Policy
- Effect: Allow
- Principal:
*
- Action:
s3:GetObject
- ARN:
arn:aws:s3:::your-bucket-name/*
Click Add Statement → Generate Policy. Paste the result into the Bucket Policy editor and click Save.
Step 6: Test the Website
Open the endpoint in your browser and confirm the site loads correctly 🎉

