Hosting an HTML File as a Static Website on an AWS S3 Bucket

Kevin Czarzasty
3 min readMay 17, 2021

Below is how I hosted a static website on AWS S3.

First I went to the S3 dashboard and clicked create bucket. Then I titled the bucket “aloha-from-s3” and created it as seen in Image 1. All other configurations I set to default. It is confirmed that my bucket was made in Image 2.

Image 1: Creating the bucket
Image 2: Confirmed bucket created

Then I used my text editor to create a small .html file (Image 3), and uploaded it to the bucket (Image 4).

Image 3: Making .html file
Image 4: Uploading .html file to the bucket

Now when I got to the object in the bucket (Image 5), I click on the hyperlink but access is denied (Image 6).

Image 5: Viewing the object
Image 6: Access denied

Therefore I now must sort the properties to make this a public site and actually host it as a static website. This needs to be done in the bucket policies, not the object, so go back to the bucket, go to policies, and I scrolled down to Edit static website hosting (Image 7 & 8)

Image 7: Locating Static Website Hosting in the bucket policies
Image 8: Editing static website hosting policies

At the above point I also specified an index.html document. I did not populate for an error document — it is optional.

I then returned to the object URL, and again I received the Access Denied page. This was expected, because I had not yet configured my permissions to allow public access. Therefore I went to my bucket’s permissions and unblocked all public access (Image 9).

Image 9: Unblocking all public access

Note that before you can unblock all public access you need to manually confirm that you want to do this by typing and entering “confirm.” (Image 10)

Image 10: Confirming unblocking all public access

Then for the third time I went to the object URL, and again I received the Access Denied page. This was troubleshot on my Mac by clicking CTRL-SHIFT-DELETE, and clearing my cache (Image 11).

Image 11: Clearing cache

If you are still facing issues & still getting the Access Denied prompt, you can then go to the folder and make public to all (Image 12).

Image 12: Making public through another method if needed

I then returned to the Object URL, and my static website was successfully hosted (Image 13).

Image 13: Aloha, Success

*Note that multiple times in this demo, I received an Access Denied prompt when trying to view the website. This is on purpose, so that I can illustrate the multiple layers of troubleshooting used to avoid this failure.*

--

--