How did I hosted a website on AWS using Static Web Hosting?

GAGAN BAHETI
3 min readApr 11, 2020

All the necessary files of a website is needed like index.html page along with CSS, Bootstrap, js, jQuery in a file folder.

Simply go to AWS S3 bucket and just develop the S3 bucket environment and login to the console with AWS free tier(make a AWS free tier account) because it gives you a limit of one year within standard terms of usage.

AWS S3 bucket gives you all the rights that are required for a user like to make the data public or private that you are storing in that S3 bucket.

You can go further to AWS S3 docs for more information.

https://docs.aws.amazon.com/s3/index.html

So starting with these steps:

1.After signing in on AWS Management Console.

2.Go to the AWS S3 bucket.

3.Click on Create Bucket

Creating Bucket in S3

4. Enter the Bucket name you want and select the region of bucket according to the needs.

Bucket settings and access: Public/Private

5. Now, it is a bucket that means it is for storing data and you want to make a static web hosting so do not block all the public access because blocking the access means you will not be able to see the content with the ARN that amazon will provide you.

AWS S3 Services with bucket created

6. Now after creating the bucket , simply click on the bucket and upload all the contents of website within folders and files. The hosting on AWS should be standard because standard version comes under AWS free Tier.

7. Make all the contents public by right clicking on them.

8. Go to the properties and enable static website hosting.

Website Properties Tab : Static Website Hosting

9. After enabling a pop-up will be opened and click on “Use this bucket to host a website” and add the index document as index.html.

If you got any error page on website then add that page too if you wish to because it is optional.

Copy the endpoint because at the endpoint the website will be opened.

Static Website Hosting Configuration

10. Simply save the settings for static web hosting and scroll to the permission page and check that all the access are public.

11. Configure the CORS configuration using the documentation available at AWS.

https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html

The Website is being hosted and using the endpoint url one can see that how it is being deployed.

TIP: Portfolio can be hosted here for Free.

--

--

GAGAN BAHETI

Something is hidden and that’s success. Just go and find it out.