How to Host Your Website on Amazon S3 - Tutorial

Published in: Amazon S3

Most web hosting companies charge you a fixed monthly fee and in return, they offer you a finite amount of storage space for hosting your web pages, images and other files.

amazon s3 for web hostingIt doesn’t really matter if you are hosting a simple website with 10 pages or a comprehensive product catalogue with thousands of pages – the amount you pay for hosting will be the same.

There’s also a limit on the amount of traffic (bandwidth quota) that your site can receive in a month. If you exceed that limit, the hosting provider is likely to suspend your site or you’ll be asked to upgrade to a different plan. On the other side, if your site receives only minimal traffic, you’ll still have to pay for the full bandwidth.

Amazon S3 vs Regular Web Hosting

Unlike web hosting companies, Amazon S3 follows a ‘pay for what you use’ model where you only have to pay for the exact amount of storage and bandwidth that your website is consuming in a month.

There’s another advantage - the Amazon S3 SLA guarantees a monthly uptime of at least 99.9% which, I doubt, is offered by any of the traditional web hosting companies.

And thanks to some recent enhancements, hosting your website on Amazon S3 is almost as easy as uploading your files to an FTP server. The only limitation is that Amazon S3 can only be used for hosting HTML websites and not dynamic sites like WordPress blogs.

How to host websites with Amazon S3

Step 1: Assuming that you already an account, log in to your Amazon S3 console. You may also use desktop-based S3 clients but to keep things simple, we’ll use the web client in this tutorial.

Step 2: Create a bucket here and give it a name which is the same as your website. For instance, if you are planning to host your website with Amazon, create an S3 bucket with same name.

Step 3: Select the new bucket and click the Upload button to upload all the web pages, images, CSS and other static files from your desktop to your Amazon S3 bucket. Click ‘Set Permissions,’ select ‘Make Everything Public’ and start the upload process.

Step 4: Now that your files have been uploaded, right-click the bucket name and choose Properties. Switch to the Websites tab, enable the websites feature and set your index.html file as the index document. Save the changes.

That’s it. Here’s a recap of all the above steps in the form of a video screencast:

Map Amazon S3 to your own Web Domain

There’s one last step. Your website is now hosted on Amazon S3 but it has a confusing web address (aka Endpoint) which looks something like this:

Since we want people to find our site at and not through the above address, we need to map the Amazon bucket address to our sweet web domain.

That’s also simple – log in to your domain hosting service and create a new CNAME Record for your domain. Set the value of this CNAME record as the Endpoint provided by Amazon S3 and save your changes. The DNS changes might take a while to propagate across the web and once that happens, your new site can be accessed from anywhere.

The Cost of Hosting Websites with Amazon S3

According to some rough calculations, if you have a 20-page website that takes about 10 MB of storage space and your site gets 200 visitors per day, the monthly hosting bill with Amazon S3 should be around $5 per month.

Not exactly cheap but the site’s uptime will be close to 100% and it won’t crash even if you make it to the front page of

Also see: How to Lower your Amazon S3 Bill

📮  Subscribe to our Email Newsletter for Google tips and tutorials!
Published in: Amazon S3

Looking for something? Find here!

Meet the Author

Web Geek, Google Developer Expert
Amit Agarwal

Amit Agarwal is a Google Developer Expert in Google Workspace and Google Apps Script. He holds an engineering degree in Computer Science (I.I.T.) and is the first professional blogger in India. He is the developer of Mail Merge for Gmail and Document Studio. Read more on Lifehacker and YourStory

Get in touch

Google Add-ons

Do more with your Gmail and GSuite account

We build bespoke solutions that use the capabilities and the features of Google Workspace for automating business processes and driving work productivity.

  1. Mail Merge with Attachments
    Send personalized email to your Google Contact with a Google Sheet and Gmail
  2. Save Emails and Attachments
    Download email messages and file attachments from Gmail to your Google Drive
  3. Google Forms Email Notifications
    Send email notifications to multiple people when a new Google Form is submitted
  4. Document Studio
    Create beautiful pixel perfect documents merging data from Google Sheets and Google Forms
  5. Creator Studio for Google Slides
    Turn your Google Slides presentations into animated GIFs and videos for uploading to YouTube