AWS Builder Center

I Built My First Static Website with AWS S3: A Student's Hands-On Record

A real account of how I built a static website from scratch using AWS S3 within the free tier—including the permission pitfalls I hit, the errors I ran into, and the complete steps that finally got it online.

Why I Chose S3 for My Website

As a student, I always wanted a portfolio website, but I did not want to pay for a server or deal with a complicated deployment process. I heard that AWS S3 could host static websites, and that the free tier was more than enough. So I decided to give it a try.
This article is not a tutorial—it is a real record of my own process, including what worked and what did not.

Step 1: Creating a Bucket—The Name Stumped Me for Ten Minutes

After logging into the AWS Console, I went to the S3 service and clicked "Create bucket."
The first problem hit immediately: bucket names must be globally unique. I tried my-portfolio, student-site, and all were taken. In the end, I used a combination like yourname-portfolio-2026 to get through.
I chose the ap-northeast-1 (Tokyo) region because it is relatively close to me, so access speed should theoretically be faster. I kept other settings as default and clicked create.
One detail here: if you plan to host a website with S3, it is best to name the bucket the same as your future domain. For example, if you want to use example.com, the bucket name should be example.com. I had not decided on a domain at the time, so I picked a random name. Later, when I wanted to switch domains, I found the bucket name cannot be changed—only recreated.

Step 2: Uploading Files—Structure Matters More Than I Thought

I prepared three files: index.html, style.css, and an avatar image.
Uploading was simple—click "Upload" and drag the files in. But I made a mistake: I initially put all files in the root directory without organizing the structure. Later, when I wanted to add a blog page, the paths became a mess.
The correct approach should be:
1
2
3
index.html
css/style.css
images/avatar.jpg
This makes maintenance much clearer later. I reorganized it afterward. It was a hassle, but worth it.

Step 3: Enabling Static Website Hosting—The Easiest Place to Go Wrong

After uploading the files, I went to the bucket's "Properties" tab, found "Static website hosting," and clicked edit.
Two things need to be set here:
  • Index document: enter index.html
  • Error document: enter error.html (optional, I skipped it for now)
After saving, S3 gives you an endpoint URL, formatted like:
1
http://your-bucket-name.s3-website-ap-northeast-1.amazonaws.com
I excitedly opened the link—and got 403 Forbidden.

Step 4: The Pitfall—Permissions

403 is the most common error, and the reason was that I had not disabled "Block all public access" and had not added a bucket policy.
Steps to fix:
  1. Go to the "Permissions" tab, click "Block public access," and uncheck "Block all public access."
  2. Under "Bucket policy," add the following policy
1
2
3
4
5
6
7
8
9
10
11
12
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::your-bucket-name/*"
}
]
}
Note: replace your-bucket-name with the actual bucket name.
After saving, I visited the URL again—and the website finally appeared. That moment felt genuinely rewarding.

Step 5: A Few Things I Learned

First, S3 static hosting is indeed free. My site has very little traffic, well within the free tier's 5GB storage and 20,000 request quota. But for high-traffic sites, S3 costs will rise, and that is when you might consider adding CloudFront as a CDN.
Second, permissions are the biggest pitfall. It took me nearly half an hour to figure out why I kept getting 403. The core is two things: disable the public access block + add the correct bucket policy.
Third, the bucket name cannot be changed once created. If you want to bind a custom domain later, it is best to use the domain as the bucket name from the start.
Fourth, cleanup matters. After testing, I deleted the test files from the bucket to avoid forgetting and incurring charges later. The free tier is enough, but good habits are always worth building.

What I Plan to Do Next

The site is now online. It is only one page, but this is the starting point. Next, I plan to:
  • Add HTTPS to the site using AWS Certificate Manager
  • Try speeding up access with CloudFront
  • Complete the portfolio content
  • If possible, bind a cheap custom domain

For Students Who Want to Try This Too

If you are also a student wanting to build a static website with S3, my advice is: just start, and do not be afraid of errors. 403s, bucket name conflicts—they are all part of the journey. S3's free tier is enough for you to experiment, and the whole process requires no investment beyond a credit card.
Most importantly, when you see the HTML you wrote displayed in a browser through AWS servers, it feels completely different from opening the file locally.
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