Hosting Your Website On Amazon S3Saving money on Web Hosting with Amazon S3.

In this guide, we’ll cover how you can set up Amazon’s S3 service to host your website and save a significant amount of money on web hosting fees when compared to the industry standard.


What is Amazon S3?

Amazon S3 (Simple Storage Service) is a service which allows you to upload files and access them via the web in a similar fashion to Dropbox. S3 plays along nicely with other Amazon services, so if you’re using AWS you’ll receive a number of discounts when those other services interact with S3.

One of the most attractive features of S3 and Amazon’s Web Services are the automated scaling abilities that come along with it. If one day out of the blue your website goes from 100 daily users to a million, your website won’t go down. AWS will automatically handle the traffic for you. You’ll pay for it of course in dollars, but if you’re getting that kind of the traffic odds are that you want visitors to be able to navigate to your site uninterrupted.


The Pricing

As of December 2014, the pricing model we’re looking at is $0.03 per GB for storage, $0.005 per 1000 GET requests and $0.09 per 1 TB of data transfer a month.

As an example, let’s say we have a website with:

  • 1 GB of storage space being consumed by the project.
  • 100 unique daily users.
  • 5 pages are requested per each user.
  • 1 MB of data transfer per each request.

The scenario above would translate into the following monthly fees:

1 GB Storage Space = $0.03 
Storage SUBTOTAL: $0.03/mo

100 Users * 5 Pages = 500 Requests a Day 
500 Requests * 31 Days = 15,500 Requests a Month 
15,500 Requests a Month / 1000 = 15.55 
15.55 * 0.005 = $0.07775 
GET Requests SUBTOTAL: $0.08/mo

100 Users * 5 Pages = 500 Requests a Day 
500 Requests * 31 Days = 15,500 Requests a Month 
15,500 Requests a Month * 1 MB = 15,500 MB 
77,500 MB / 1000 = 15.5 GB 
15.5 GB * 0.09 per GB = $1.395 
Data Transfer SUBTOTAL: $1.40/mo

Your monthly total would be: $1.51/mo!

The majority of web hosting services out there charge more than that and don’t come equipped with the automated scaling capabilities that you’ll get with Amazon S3.

Plug in your own numbers and see if the cost benefits of making the switch are worth it for you. For me, the switch yielded thousands in savings per year.

To see the current Amazon S3 pricing rates visit Amazon’s S3 Pricing Page


Getting Started

This guide assumes that you have an AWS account and novice knowledge at a minimum of how to set up a website.

To get started login and navigate to your AWS Dashboard. From your dashboard click on the S3 link to navigate to the Amazon S3 homepage. In the picture below it’s the 3rd item on the left-hand column.

You should now be at your Amazon S3 homepage.

Click the Create Bucket button at the top left of the page to open a modal which will ask you for the Bucket Name and Region for your new Bucket.

The value of the Bucket Name is for you to uniquely identify each of your sites, and the Region is for you to specify where geographically you want the Bucket to be hosted.

The Region isn’t required, you can simply leave the dropdown blank and AWS will automatically set it for you. After entering a Bucket Name click the Create button to generate your new Bucket.

After creating your new Bucket, you’ll now see that it’s listed on the left-hand side of the page. Now click on the File Icon next to your newly created Bucket so that we can modify the settings for it.

Under your Bucket settings expand the section that’s titled Static Website Hosting.

In this section, you should see the URL Endpoint for your bucket. In the picture below you’ll see that mine happens to be salvatore.garbesi.com-s3-website-us-east-1.amazonaws.com. This is URL that you’ll use to directly access your website, and if you want to use a custom domain you’ll need to add a CNAME record to your DNS provider which contains this value.

Next, select the option Enable website hosting. After selecting this option you should see the field Index Document, this is where you need to specify the default filename for your website (usually it’s index.html).

After entering your Index Document click on the Save button.

At this point, we’re done as far as configuration goes! Now you need to upload your website.


Uploading Files To Amazon S3

From your Amazon S3 homepage, click on the link of the bucket that you want to upload your files to.

After clicking the link you’ll be brought to the buckets file navigation interface. Whenever you upload files to your bucket, they’ll show up here and you can manage them directly from the website.

On the top left of the page click on the Upload button.

The rest is pretty much self-explanatory. Happy uploading!


Looking Back

Although AWS can seem intimidating or daunting at first with the large number of services it provides, you can see how easy it is to actually get a website up and running with little expense.

We covered how much hosting your site would cost and how to host your website on Amazon’s S3 service. If the numbers work for you, then happy savings! If not, then hopefully it was a good learning experience that you may be able to apply for a future project.

About Salvatore Garbesi