How to Set Up an S3 Static Website Using AWS S3 Bucket
How to Set Up an S3 Static Website Using AWS S3 Bucket

Learn to transform your S3 bucket into a s3 static website with easy steps, including setup, configuration, and access control for global reach.

Table of Contents

Amazon Simple Storage Service (S3) is known for being scalable, secure, and reliable, which makes it a solid choice for hosting static websites. You can easily turn a regular S3 bucket into an S3 static website and serve HTML, CSS, and JavaScript files without the need for a traditional web server.

However, S3 offers a specific way to enable a static website beyond just directly accessing the objects. In this article, we will learn how to convert your S3 bucket into a static website.

Prerequisites

Before you proceed, ensure you have the following:

  • An active AWS account
  • An S3 Bucket created
  • Static website files (HTML, CSS, images, or JS)

Enabling Public Access to Your S3 Bucket

Navigate to your S3 bucket.

S3 bucket

Click on the “Permissions” tab from inside your bucket.

S3 bucket objects

By default, you will see that all public access has been blocked from your S3 Bucket.

Unblocking public access

To enable public access, click on “Edit.” Uncheck the “Block all public access” option and click on “Save changes.”

Unblocking public access

You will be asked for confirmation. Write “confirm” and click on the “Confirm” button.

Following confirmation

Next, scroll down to the “Bucket Policy” section and click on the “Edit” button.

Bucket Policy

Click on “Policy generator.” This will take you to the AWS Policy Generator webpage.

Generating Bucket Policy

In step 1, select the policy type as “S3 Bucket Policy.”

AWS Policy Generator

Now, in step 2, under “Add Statements,” select the effect “allow,” set the principal to “*,” and in action, select “GetObject.” This will allow others to access files from your S3 bucket.

Step to bucket policy

Head back to your bucket policy page and copy the bucket ARN (Amazon Resource Name).

Edit bucket policy

Paste it into the ARN section on the policy generator page, then add “/*” following it. This ensures the policy affects all objects in the bucket. Now click on “Add Statement.”

Filling in the ARN

This will create the statement. Click on “Generate Policy.”

Generating policy last step

Copy the contents of the JSON Document.

Successful policy generation

Go back to the “Edit bucket policy” page and paste the generated bucket policy.

Editing the bucket policy

Save the changes to make the S3 bucket public.

Enabling Static Website

Navigate to the “Properties” tab of your bucket.

S3 bucket properties

Scroll down to the bottom, and in the “Static website hosting” section, click on “Edit.”

Enabling Static Website

In static website hosting, click on “Enable.”

Enabling static website

Once you click it, more options will appear. In “Hosting type,” select “Host a static website.”

Static website setup

Scroll down and click “Save changes.”

Now check the “Static website hosting” section from the “Properties” tab again. You will see a URL given to you for accessing the S3 bucket’s static website.

Static website

If you’ve followed everything correctly, you should be able to access your S3 bucket static website. Unlike the regular S3 bucket, the file now has a different URL suffix, and you don’t need to use “index.html” or a direct link to the file.

s3 static website

That concludes this article.

Amazon S3 simplifies static website hosting, providing a secure, scalable, and cost-effective platform. By following a few steps to enable public access and configure static website hosting, you can effortlessly make your content accessible online, showcasing the convenience and efficiency of utilizing AWS for your web hosting needs.

🗂️ Setting up an S3 bucket but unsure about configuration, security, or best practices?
Elite Cloud can help you properly design, secure, and manage your Amazon S3 buckets—from access control and encryption to lifecycle policies and cost optimization.
👉 Book a session with the Elite Cloud team today and ensure your S3 buckets are efficient, secure, and ready to scale!

AWS AWS S3