Hosting static website with Amazon s3

priyanka kumari
3 min readDec 9, 2023

--

in this guide, we’ll walk through the process of hosting a static website on Amazon Web Services (AWS) using two key services: Amazon S3 (Simple Storage Service) and Amazon CloudFront (a content delivery network or CDN). Before we dive in, let’s clarify some terminology:

Amazon S3: Amazon S3 is a web service provided by AWS for object storage. It allows you to store and retrieve various types of data, such as documents, images, and videos. In the context of hosting a static website, an S3 bucket serves as a container where you can upload your website’s files and folders.

Amazon CloudFront: Amazon CloudFront is a CDN service by AWS designed to accelerate content delivery. It can be seamlessly integrated with Amazon S3, helping to distribute your website content globally and improve its performance.

Benefits of Using AWS S3 Bucket:

Each object can store up to 5TB of data.

Access to resources is restricted to the owner by default, ensuring security.

Cost-effective storage solution.

Multi-Factor Authentication (MFA) delete can be enabled to prevent accidental deletions.

Prerequisites:

Before you begin, ensure you have the following:

An AWS account (you can sign up here).

Your website files ready for upload (HTML, CSS, JS, etc.).

Steps to Host a Static Website Using S3:

Create an S3 Bucket:

Sign in to the AWS Console.

Navigate to S3 and create a new bucket.

Upload Website Files:

Upload your HTML, CSS, JS files, and other assets to the newly created S3 bucket.

Enable Static Website Hosting:

Configure the S3 bucket properties to enable static website hosting.

Configure Permissions:

Set a bucket policy to allow public access to your website files.

Access Your Website:

http://hosting-aws-website.s3-website.ap-northeast-3.amazonaws.com/

Use the provided S3 endpoint URL to access your static website.

Conclusion:

Hosting a static website on AWS using S3 and CloudFront offers benefits such as scalability, security, and improved content delivery speed. Follow these steps to set up your website and share the guide with others who might find it helpful. Tag your colleagues and friends who could benefit from this information. If you have any questions or feedback, feel free to share. Happy hosting!

Thanks for reading

I hope found this useful?

✅Reshare this with others so that it helps more people

✅Tag your colleagues and friends who you think will need this

--

--

priyanka kumari
priyanka kumari

Written by priyanka kumari

Cloud || Devops enthusiast|| Learning & helping

No responses yet