How to host a Static Website using AWS using S3

Sudheer Panangipalli
2 min readMay 3, 2021

AWS is a cloud platform that offers you different kinds of services like Storage, Compute, Containers etc. In this article we will be using storage service of AWS specifically ‘S3’

What is ‘S3’?

S3 is a storage where you can store files (referred as objects) which is similar to File system in a Local computer. There certain additions like Versioning, Blocking public access, Encryption.

In case you are wondering how do we host a static website in AWS here is how.

  1. Log into your AWS account and navigate to ‘S3’ storage.
  1. Now click on create bucket, you will be navigated to create bucket page
  2. Now fill the name column and select a region where you want to store this bucket.
  3. Now uncheck the block public access and check the acknowledgement below.
  4. Leave the remaining options (Versioning and Encryption are chargeable features) and click on create bucket.
  5. Once your bucket is created upload your website files to your bucket by clicking on upload option
  6. After successful upload go back to the bucket and select all files in options select make as public.
  7. Now go back to you bucket and select properties tab, scroll down to find static website hosting option and click on edit
  8. Select enable in Static website hosting and hosting type as host a static website

Now you need to mention index document which is the first html page of your static website(in case you created folder in you bucket then include folder name as well “folder-name/index.html”) click on save changes

Now go back to static website option in properties of the bucket there will be a URL use it to access your website the same URL can be accessed by anyone since you made the objects of your bucket public

That’s it you have successfully hosted a static website in AWS.

You can decrease the latency of your static website using CloudFront feature in AWS which will be explained in next article

--

--