Did you know you can host a static website on Amazon S3? A better question is why should you use AWS to host a static site?
- You can use CMS and other development platform support.
- There are data centers worldwide. Your customers can be anywhere.
- Dynamically grow and shrink resources. AWS can scale based on your organization needs.
- Flexible pricing models. AWS only charges you for the resources you use.
Now, that you’re curious and want to give it a try. Let’s get started.
Login to your AWS Console. If you don’t have an existing an account get started with an AWS Free Tier account.
Create a new S3 bucket to host your website.
AWS Console > Services > S3 > +Create bucket
I’m naming my bucket mys3websitemiramesa. Keep the default for properties and permissions.
Click on your new bucket and go to the properties tab. Enable Static website hosting
Select the option to User this bucket to host a website
Next, we’re going to create an index.html and error.html and upload to your bucket.
Go to the permissions tab then Public access and allow everyone to read.
In the mys3websitemiramesa properties > Static Website you can find your link to view your site. Copy and paste the endpoint link into a browser.
You will see your website.
If you change permissions for your index.html page to disable users to read then click on your endpoint link again. You will see your error.html page.
The great thing about hosting a static website on AWS is that AWS will scale for you. It can handle any load with hundreds or thousands of users.
You’ll probably wonder how much is this going to cost? Well, that depends. If you are using the AWS Free Tier and within the limits, it will cost you around $.50 a month. If you’re outside of the free tier it will cost around $1-3 a month. For a breakdown of cost using the Simply Monthly Calculator here.