Amazon Simple Storage Service
Developer Guide (API Version 2006-03-01)

Example: Setting Up a Static Website

You can configure an Amazon S3 bucket to function like a website. This example walks you through the steps of hosting a website on Amazon S3. In the following procedure, you will use the AWS Management Console to perform the necessary tasks:

  1. Create an Amazon S3 bucket and configure it as a website (see Creating a Bucket and Configuring It As a Website).

  2. Add a bucket policy that makes the bucket content public (see Adding a Bucket Policy That Makes Your Bucket Content Publicly Available).

    The content that you serve at the website endpoint must be publicly readable. You can grant the necessary permissions by adding a bucket policy or using Access Control List (ACL). Here we describe adding a bucket policy.

  3. Upload an index document (see Uploading an Index Document).

  4. Test your website using the Amazon S3 bucket website endpoint (Testing Your Website).

Creating a Bucket and Configuring It As a Website

  1. Sign in to the AWS Management Console and open the Amazon S3 console at

  2. Create a bucket.

    For step-by-step instructions, go to How Do I Create an S3 Bucket? in Amazon Simple Storage Service Console User Guide.

    For bucket naming guidelines, see Bucket Restrictions and Limitations. If you have your registered domain name, for additional information about bucket naming, see Customizing Amazon S3 URLs with CNAMEs.

  3. Open the bucket Properties panel, click Static Website Hosting, and do the following:

    1. Select the Enable website hosting.

    2. In the Index Document box, add the name of your index document. This name is typically index.html.

    3. Click Save to save the website configuration.

    4. Note down the Endpoint.

      This is the Amazon S3-provided website endpoint for your bucket. You will use this endpoint in the following steps to test your website.

Adding a Bucket Policy That Makes Your Bucket Content Publicly Available

  1. In bucket Properties panel, click the Permissions.

  2. Click Add Bucket Policy.

  3. Copy the following bucket policy, and then paste it in the Bucket Policy Editor.

    { "Version":"2012-10-17", "Statement":[{ "Sid":"PublicReadForGetBucketObjects", "Effect":"Allow", "Principal": "*", "Action":["s3:GetObject"], "Resource":["arn:aws:s3:::example-bucket/*" ] } ] }
  4. In the policy, replace example-bucket with the name of your bucket.

  5. Click Save.

Uploading an Index Document

  1. Create a document. The file name must be same as the name that you provided for the index document earlier.

  2. Using the console, upload the index document to your bucket.

    For instructions, see How Do I Upload an Object to an S3 Bucket? in the Amazon Simple Storage Service Console User Guide.

Testing Your Website

Enter the following URL in the browser, replacing example-bucket with the name of your bucket and website-region with the name of the region where you deployed your bucket. For information about region names, see Website Endpoints ).


If your browser displays your index.html page, the website was successfully deployed.


HTTPS access to the website is not supported.

You now have a website hosted on Amazon S3. This website is available at the Amazon S3 website endpoint. However, you might have a domain such as that you want to use to serve the content from the website you created. You might also want to use Amazon S3's root domain support to serve requests for both the and This requires additional steps. For an example, see Example: Setting Up a Static Website Using a Custom Domain.