Getting Started with AWS
Hosting a Static Website
Next »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Go to the Kindle Store to download this guide in Kindle format.Did this page help you?  Yes | No |  Tell us about it...

Hosting a Static Website on Amazon Web Services

You can easily and inexpensively use Amazon Web Services (AWS) to host a website that uses client-side technologies (such as HTML, CSS, and JavaScript) and does not require server-side technologies (such as PHP and ASP.NET). This type of site is called a static website, and is used to display content that does not change frequently.

If you want to deploy a website that requires server-side technologies instead, see Getting Started with AWS Computing Basics for Linux or Getting Started with AWS Computing Basics for Windows.

After you complete this tutorial, you'll know how to do the following:

  • Deploy a static website – Host your static website using the Amazon Simple Storage Service (Amazon S3) so that it is secure, fast, protected against data loss, and can scale to support enterprise-level traffic. You'll store your website files in Amazon S3 and use Amazon S3 to deliver your content to visitors to your website.

  • Associate your domain name with your website – Use Amazon Route 53 to tell the Domain Name System (DNS) where to find the resources for your domain, such as your website content in Amazon S3.

  • Speed up your website – Use Amazon CloudFront to create a content delivery network (CDN) that makes your website content available from data centers around the world, called edge locations. Using edge locations improves the speed of your website. This is especially important if your website displays large media files such as high-resolution images, audio, or video.

Static Website Hosting Architectures

Before you create and deploy a static website, you must plan your architecture to ensure that it meets your requirements. The following table shows how Amazon S3, Amazon Route 53, and Amazon CloudFront work together to provide a seamless and cost-effective solution.

RequirementSolution

Low-cost, reliable, online storage to host your static website

Amazon S3 is a low-cost, highly reliable web service for hosting static websites.

A reliable and cost-effective way to route customers to your website

Amazon Route 53 maps human-readable domain names to IP addresses and AWS locations.

A way to deliver content with low latency and high data transfer speeds so that visitors to your website don't experience unnecessary delays

CloudFront speeds up the loading of streaming or downloaded static content by caching the content in edge locations. When your customer visits your site, CloudFront delivers the content from the location that is geographically closest to your customer, ensuring the lowest possible latency.

To start hosting a static website on AWS, you'll do the following:

  1. Create a location, that is, an Amazon S3 bucket, where you will store the files, such as HTML, CSS, JavaScript, and images, for your website.

  2. Upload the files to this bucket.

  3. Make the files publicly viewable.

  4. Configure the bucket to act as a website.

After you complete these first steps, visitors can access your website with a URL in the form http://example.com.s3-website-us-east-1.amazonaws.com or http://wwwexample.com.s3-website-us-east-1.amazonaws.com.

Next, you can add a custom domain to your static website by registering a domain name and configuring AWS as your DNS service provider. Visitors can now access your website with a URL in the form http://example.com or http://www.example.com.

Finally, you can improve performance of your website by distributing it through a CDN. Visitors can still access your website with a URL in the form http://example.com or http://www.example.com, but now they'll download the files from the edge location closest to them.

Pricing

You can use the AWS Simple Monthly Calculator to estimate what it would cost to host your static website on AWS using Amazon S3, Amazon Route 53, and CloudFront.

Note that if you created your AWS account within the last 12 months, you are eligible for the AWS Free Tier.

For more information about AWS pricing, see Pricing.