Host a Static website on AWS S3

Sharmila S
featurepreneur
Published in
3 min readJul 5, 2021

Amazon S3 —( Amazon Simple Storage Service) Cloud Object Storage service by AWS. It allows users to store and organize data in the cloud.

Static Websites — Simple websites don't have a backend service or connection to a database.

Steps:

Go to your AWS account, if you do not have one already, you can sign up for a new account here.

Go to the service S3. Create a new bucket by clicking on the ‘Create Bucket’ button to host our website.

Provide a bucket name, and note that it must be unique across the world.

Allow public access, so that our website is visible for the users on the web.

Then, click on ‘create bucket’.

A new bucket is created. Let’s upload our application files into the bucket. Click the bucket created to continue.

Now, under the Objects tab, select the Upload button.

Upload the necessary files. Then, scroll down to permissions settings.

Select ‘Grant public-read access’ to the files. Finally, upload the files to the bucket.

Let’s make our bucket to host the static files.

Select the Properties tab of the bucket.

In the Properties tab, you would see an option for static website hosting. Click Edit.

Select the Enable radio button to enable hosting.

Then, select ‘Host a static website’ as the hosting type.

You should specify the index document which represents the home page. You can also mention the error page that is to be returned in case of errors (it is optional). Lastly, Save the changes.

You can view the list of uploaded files now, click on the index.html (default file) to view its properties.

In the properties, find and copy the object URL.

Paste the URL in your browser to view the hosted website.

hosted static site

Happy learning! Follow for more articles!

--

--

Sharmila S
featurepreneur

Software Engineer | Writes about Full Stack Web Development | 1 X AWS | CKA http://sharmilas.bio.link/