Amazon S3 can be used to host static websites, making it an easy and cost-effective solution for serving HTML, CSS, JavaScript, and images. In this guide, we will walk through the steps to enable S3 static website hosting, upload files, and access them via a public URL.


1. Uploading Files to S3 Bucket

To host a website, we first need to upload the necessary files:

  1. Navigate to your S3 bucket.
  2. Click Upload.
  3. Add the required files (e.g., index.html, beach.jpg).
  4. Click Upload to store the files in the bucket.

Example Files:


2. Enabling Static Website Hosting

Once the files are uploaded, we enable static website hosting:

  1. Open your S3 bucket and go to the Properties tab.
  2. Scroll down to Static website hosting.
  3. Click Edit and choose Enable.
  4. Select Host a static website.
  5. Specify the Index document (e.g., index.html).
  6. Click Save.