How to Create an AWS S3 Bucket to Host Your Landing Page or Static Site
About Amazon S3
Amazon S3 (Simple Storage Service) is a cloud storage solution, which can store any kind of data, such as images, files, etc. However, it can also store web pages which can be made public. This means S3 provides you with an instant, cheap and highly reliable, simple web site hosting solution.
Amazon offers a “free tier” which includes many of the services you might need for hosting your own landing page or static site. https://aws.amazon.com/free/
How S3 Works
Amazon S3 can be thought of as a key / value store. You create a key (bucket name) and store a value (an object such as an image, file, etc). This means when you want to access an object stored in your bucket you simply need to know the name of your key, and “call” it.
S3 is a very powerful service and can be configured in a number of different ways. This configuration is done through a “policy file”. In order to make our S3 bucket host a web site, we need to add an appropriate policy file to it.
Additionally you can specify what “region” your S3 bucket will be located in. This allows you to chose a region that optimizes for latency, minimizes costs and addresses any regulatory requirements you might have.
Create an S3 Bucket
- Log into AWS (Amazon Web Services) and open up the S3 service: https://console.aws.amazon.com/s3.
- Click the “Create Bucket” button, this opens a floating dialog box, to capture the name of your bucket and the region of where you want it to live.
The bucket name should be the name of your domain name including the “www.” unless you want a “naked” domain. However in most cases you should keep the “www.”. For more information see: http://www.yes-www.org/why-use-www/
The region should reflect where the majority of your customers are likely to be located. Ignore “Set Up Logging” and click the “Create” button.
3. Once the bucket has been created you can see all it’s properties in the right hand pane (ensure the “Properties” button is selected).
4. Select the “Permissions” section and click the “Add bucket policy” button. This opens a dialog box where you can enter in the “policy text” that will make the contents of your bucket publicly available over the Internet.
Enter the following policy text into the text field of this dialog box. Note that my bucket is called www.golandingpages.com so you must change this to whatever your bucket is called.
Click this policy dialog “Save” button, and then click the permissions “Save” button.
5. Now click the “Static Website Hosting” section and select the “Enable website hosting” radio button. You now need to enter the file name of the main web site HTML file that you want S3 to serve to your visitors. In our case this file is called index.html.
Before you save these changes. Note down the Endpoint (e.g. www.golandingpages.com.s3-website-us-west-1.amazonaws.com), this is Amazon’s own private URL link to the contents of this bucket. Finally click the “Save” button.
6. Our bucket is currently empty and can’t serve up a web page. With a text editor create a new file called index.html and add some text to it before saving.
7. Upload your index.html file by clicking the “Upload” button or selecting upload from the “Actions” button.
8. Finally you should be able to open your browser, enter the URL Endpoint from section 5, and navigate to your newly hosted web page.
With any luck you have how used Amazon to set up and host your own web page. This web page could just be a simple landing page, or it could be a large static web site (i.e. not database driven). What is interesting is that this is just the first step, the Amazon services are extremely powerful and you can take your ideas into any direction you need.
I would love to hear what you build, let me know in the comments below. Also if you have an idea and need a landing page or static web site then…
Please see my Udemy course “Go Landing Pages” and get SAVE $5 with this coupon: https://www.udemy.com/go-landing-pages/?couponCode=MEDIUM25