Resources

*Please download the resources file before you proceed with the steps.

Have you ever wanted to host a static website for your company but didn’t want to pay outrageous prices? Amazon S3 can help! Hosting with Amazon S3 is free, and the only cost you will incur is if you store data over 10TB. This blog post will teach you how to host a static website using Amazon S3bucket.

There are many cloud providers, but here we are using AWS because:

  • The number one reason to use AWS is that they offer a “Free Tier” which means you don’t have to worry about paying for your usage.
  • The second big benefit of using AWS service is scalability and elasticity. These two things allow AWS to be able to provide high performance under tremendous load with minimal impact on functionality or latency times there’s no downtime!
  • Finally, the third one is security.

There are other cloud providers out there such as Microsoft Azure and Google Cloud Platform that offer a similar service to S3. This means you can use the concepts discussed in this post with these competitors too!

Most websites are static and don’t run server-side code. They only have HTML, CSS, and JavaScript. With no need to run the server-side code, there is no reason to host them on a traditional server.

What is Amazon S3?

Amazon S3 is an AWS service that provides a safe place to store your data. It’s a cloud-based storage system, so there are no limits on space and you can access it from anywhere.

Build Your Career as a
AWS Solution Architect

AWS Solutions Architect Associate

Boost your earning potential with AWS expertise. Explore our certified AWS Courses for a high-paying career

learn more about hosting a static website using Amazon S3. Then let’s jump in.

  1. Login into AWS Management Console and search S3.
  2. Create a new Bucket or select an existing Bucket.
To create a new bucket follow the steps given in Create S3 Bucket and Objects
  1. Open the S3 Bucket dashboard and upload the HTML file and click on Upload.

You can see objects uploaded in the bucket now.

  1. In S3 Bucket, open Properties.

5. Click on Edit in Static website hosting.

6. In Edit static website hosting, select Enable to enable website hosting in AWS S3.

7. Now in Index Document specify the name of the home page or default file of the website and Error document – optionally specify the name of the file which is returned when an error occurs.

8. Click on Save Changes.

You have successfully hosted your website through S3 Bucket. You can get the website URL from Static Website Hosting in Properties.

Note: Make sure that your S3 Bucket is Public otherwise you will get errors while accessing your website.

Steps to make Bucket Objects Public:-

  1. Select Edit in Block public access (bucket settings) in S3 Bucket Permissions.

2. Now uncheck the box against Block all public access and Save Changes.

3. Confirm all the settings in the pop-up and Save.

You have made all objects public in your Bucket.

Now we will follow a few steps to make S3 Bucket Public make it accessible for all the https://thinkcloudly.com/wp-content/uploads/2022/09/Google-Cloud-Architect.pngs. To do so we need to write a simple Bucket Policy, let’s continue…

  1. Inside the Bucket S3 dashboard, Click on Permissions and then click on Edit in Bucket Policy.

2. Now go to Policy Generator

.3. In Select Policy Type choose S3.

4. In Add Statement, choose effect as Allow and Principal as * to select policy for all the users. Select all Actions you need to allow.

Here, we will only choose Get Object as we only want to read objects uploaded by the user.Static Website

  1. In Amazon Resource Name, Copy and Paste the ARN from Edit Bucket Policy Tab. Add “/*” after the ARN to apply this to all the objects inside the Bucket.
  2. Click on Add Statement and then on Generate Policy.
  3. Copy the Policy JSON Document to the Policy editor and Save the Changes.

Hosting a static website using Amazon S3

Congratulations! You have successfully configured all settings for AWS S3 Website Hosting. Now you can access your Website URL easily and publically.

Conclusion:

The world of AWS is one you’ll want to learn more about. There’s a lot out there on the topic, and it can become difficult for those looking into getting started with such knowledge overloads in their searches.

The best way to learn AWS is by doing. Reading books isn’t enough, you need hands-on experience! That’s why I hope that this post helped you cut through all the information and gave something practical for your future in cloud development or deployment needs- because learning doesn’t stop with just reading these days. There are so many resources out there now where you can practice what was learned.

If you’re looking for a way to learn about the vast world of technology and how it works, then this post might be just what you are interested in. We’ve got information on Amazon Web Services as well! Check out our other blog posts if that’s not enough or even better yet try one of their AWS courses designed by experts who know all about these things inside-out so they can teach YOU THE SKILLZ too…

See you in the next blog. Happy Cloud Computing.