Orisadare Damilola Racheal
3 min readFeb 2, 2024

A step by step guide to hosting a static website on Amazon S3

Introduction:

In the ever-evolving landscape of web development, hosting a static website has become an efficient and cost-effective option. Amazon Simple Storage Service (S3) provides a reliable solution for hosting static websites with high scalability and low latency. In this guide, we will walk through the steps to host a static website on Amazon S3.

Pre-requisites

AWS user account with admin access not a root account

Step 1: Create an Amazon S3 Bucket:

1.1. Log in to your AWS Management Console.

  1. 2. Navigate to the S3 service and click on “Create bucket.”

1.3. Choose a unique and meaningful name for your bucket, following S3 naming conventions.

1.4. Select the region where you want to create the bucket.

1.5. Configure other settings, such as versioning and logging, according to your preferences.

  1. 6. Click “Create bucket” to finalize the process.

Step 2: Upload Your Website Files to the S3 Bucket:

2.1. Open the newly created bucket and navigate to the “Upload” button.

2.2. Add your website files to the upload queue, ensuring that your main HTML file is named “index.html.”

2.3. Configure permissions for your files, setting them to be publicly accessible.

2.4. Complete the upload process.

Step 3: Enable Static Website Hosting:

3.1. In the S3 bucket dashboard, go to the “Properties” tab.

3.2. Click on the “Static website hosting” card.

3.3. Select the option to use this bucket to host a static website.

3.4. Enter the names of your main and error documents (usually “index.html” for both).

3.5. Save the changes.

Step 4: Configure Bucket Policy for Public Access:

4.1. Navigate to the “Permissions” tab in your S3 bucket.

4.2. Click on “Bucket Policy” and add a policy that allows public access to your website files. Be cautious with security configurations.

4.3. Save the bucket policy.

Step 5: Obtain the Website Endpoint:

5.1. In the S3 bucket dashboard, check the “Static website hosting” card for the endpoint URL.

5.2. Copy the provided URL; this is the endpoint where your static website will be accessible.

Step 6: Test Your Static Website:

6.1. Open a web browser and paste the endpoint URL.

6.2. Verify that your static website loads correctly.

Conclusion:

Congratulations! You’ve successfully hosted your static website on Amazon S3. Leveraging the power of S3 for static web hosting not only ensures reliability and scalability but also offers a cost-effective solution for projects of all sizes. As you explore the capabilities of AWS, remember to optimize your configurations based on your specific needs and security considerations. Happy hosting!

Orisadare Damilola Racheal

Cloud/Devops Professional in training | follow me on my projects documentation journey