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

If you want to host a website that only uses client-side technologies (such as HTML, CSS, and JavaScript) and that does not require server-side technologies (such as PHP and ASP.NET), you can easily and inexpensively host the site on Amazon Web Services (AWS). This type of site is sometimes referred to as a static website, and it is typically used to display reference material that does not change frequently, such as product manuals, informational sites, or documentation.

This guide walks you through the process of hosting a static website on AWS. We'll use the AWS Management Console to configure the AWS services we need.

By the end of this guide, you should be able to do the following:

  • Host a static website – a static website hosted on Amazon Simple Storage Service (Amazon S3) can scale to support enterprise-level traffic. It is secure and fast, and it protects against data loss. Using Amazon S3, you can have a robust website without updating or managing server software. Amazon S3 provides a place to store your website files, and it delivers your files to site visitors.

  • Associate a custom domain name with your websiteAmazon Route 53 is a domain name service (DNS) that makes it easy to associate a custom domain name (such as with your website hosted on Amazon S3.

  • Increase the speed of your websiteAmazon CloudFront creates a content delivery network (CDN) that makes your website content available from data centers around the world, called edge locations, so your visitors can download content from a location near them. Using edge locations to serve web pages improves speed and reduces latency. Amazon CloudFront is especially useful if your site displays large media files such as high-resolution images, audio, or video.

If you want to host a website that requires server-side technologies, see Getting Started with AWS Computing Basics for Linux, which explains how to configure a virtual web server by using Amazon Elastic Compute Cloud (Amazon EC2). The guide includes instructions for installing Drupal, a popular open-source content management system (CMS) that uses PHP and MySQL. You can use the same process to create a WordPress site or a website that uses a custom PHP application. Also see Getting Started with AWS Computing Basics for Windows, which describes how to deploy DotNetNuke, an open source CMS that runs on the Microsoft Windows operating system.

What AWS Services Do I Need?

If you are creating and deploying a static website, you'll face infrastructure challenges. Where will you store your files? How will you deliver your content? How will you ensure reliability and high performance for your website? How will you route visitors to your website? To solve these challenges, AWS provides Amazon S3, Amazon Route 53, and Amazon CloudFront for seamless, and cost-effective solutions.

The following table gives a brief overview of the Amazon services used in this Getting Started Guide.

ChallengesAmazon Web ServicesBenefits

You need a low-cost, reliable online storage web service to host static website content.

Amazon Simple Storage Service (Amazon S3)

Amazon Simple Storage service offers a low cost, highly reliable solution for hosting static website content.

You need a reliable and cost-effective way to route end users to Internet websites.

Amazon Route 53

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

You need to deliver content with low-latency and high data transfer speeds so website visitors don't experience unnecessary delays.

Amazon CloudFront

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 with the lowest latency.

Static Website Hosting Architectures

This guide walks you through the process of hosting a static website on AWS. There are three options for how you configure your static website, depending on the functionality you require.

In the first option, you'll do the bare minimum to host a static website on AWS: create a place to store files, upload the website files (HTML, CSS, Javascript, images), make the files publicly viewable, and then configure the storage location to act as a website. With this option, visitors access the website with a URL of the form

In the second option, you'll add a custom domain to your static website by configuring AWS as your DNS service provider. Visitors can now access the site with a custom URL like

In the third option, you'll improve performance of your website by distributing it through a content distribution network. Visitors will still access the site with the custom URL (, but now they'll download the files from a CDN server close to them.

The following steps walk you through the tasks needed to set up each of the three options above. They follow best practices and demonstrate how different AWS products work together to deploy and run the website.