How to Create a Static Website (on AWS)

Register for AWS

Sign up for Amazon Web Services (AWS).

Create an Admin account

AWS also strongly recommends creating a separate AWS Administrator account for added security. This account will be used to create your site.

Make sure to download the CSV containing your login credentials and access/secret keys at the tail end of the process. And store them in a secure place!!

Create an S3 bucket

In this step we'll create an AWS Simple Storage Service (S3) bucket to host the HTML and other files used by our static site.

You should now have a private bucket that noone can view. You can test this by uploading a file and then trying to access it using the "Object URL" (this can be retrieved from the Overview tab after clicking on an uploaded file in the S3 console).

In the next step, we'll update the bucket's settings to serve as a public website.

Enable website hosting

Now that we have a bucket, it's time to enable it for website hosting. What follows is a distilled version of the process. See Configuring a bucket for website hosting for more details.

See the website endpoints documentation for more details on how to access your public site.

Clean URLs

This type of setup has the added benefit of clean URLs -- i.e. the ability to use URLs
that end in a / -- when using index.html pages inside an S3 directory.

For example, http://example-bucket.s3-website-us-east-1.amazonaws.com/somepath/ will automatically display the index.html inside of the somepath/ directory in your bucket.

En fin

Congratulations! You now have a static S3 website. Next, we'll add a custom domain and HTTPS to lend some polish to the site.