How to host a website on Amazon AWS S3?

How to host a website on Amazon AWS S3?

Link to tutorial video: https://youtu.be/eYpV14z5F3Q

AWS S3 stands for Simple Storage Service. Customers of all sizes and industries can use it to store and protect any amount of data for different use cases such as websites, mobile applications, backup and restore, archive, enterprise applications, etc.

What is Amazon AWS S3?

AWS S3 is an object storage service that offers industry-leading data availability, scalability, security, and high performance.

According to Amazon Amazon S3 is designed for 99.99% of durability, and stores data for millions of applications for companies and customers all around the world.

What are the benefits of using AWS S3?

Some of the benefits of using AWS S3 are:

  1. Low cost
  2. Easily manage data and access control
  3. Simple data transfer
  4. High-level security by Amazon
  5. Industry-leading performance, scalability, availability, and durability

What is the AWS S3 bucket?

A bucket is a place in S3 where all of your data is stored. To upload your data, as - photos, videos, documents, etc, to Amazon S3, you must first create an S3 bucket in your AWS Regions. After that, you can upload your data in that bucket.

An Amazon S3 bucket name is globally unique for everyone. This means that after a bucket is created, the name of that bucket cannot be used by any other AWS account in any AWS Region until the bucket is deleted.

How to host a website on AWS S3?

Login to your AWS account

No alt text provided for this image

After that search for S3 in the AWS console Search box.

No alt text provided for this image

Open the S3 and You will see an interface like this.

No alt text provided for this image

Click on the "Create bucket"

No alt text provided for this image

Name your bucket. The bucket name is unique for everyone. After just click on "Create".

Once your bucket is created then just click on the bucket name and enter in that. After that click on upload and upload your website.

No alt text provided for this image

Once your files are uploaded then just click on the properties tab and under that section change the setting of "static website hosting" - " Use this bucket to host the website".

No alt text provided for this image


After that, you will be required to give the names of the home page and error page. i.e. - index.html and error.html

Note: If you do not have any error page then you can simply give homepage name in it.

No alt text provided for this image

Once done with properties then click on Permissions. Here you have to update the settings to allow the public access as we want everyone to see our website. So just turn off the Block all the public access tab.

No alt text provided for this image

After that in the same tab of Permissions just click on the bucket policy and put the following policy there.

{

"Version": "2012-10-17",

"Statement": [

{

"Sid": "PublicReadGetObject",

"Effect": "Allow",

"Principal": "*",

"Action": "s3:GetObject",

"Resource": "arn:aws:s3:::[YOUR_BUCKET_NAME]/*"

} ]

}

Note: '[YOUR_BUCKET_NAME]' with your actual bucket name

No alt text provided for this image

Save the bucket policy and come back to the Properties tab and in the static website hosting section you will have your website URL. You can visit the URL and your website will be live there.

Link to Video on How to host a website on AWS S3: https://youtu.be/eYpV14z5F3Q

Let me know in the comments if you have any other doubts :)

Happy Learning!





Bhuvneshwar Tanwar

Data Analyst at Statfinity | From Data to Decisions | Python | SQL | Looker Studio | GCP | GA4 | Power BI.

4 年

This is helpful for everyone..?

Nicholas Musau

Spatial Data Scientist || EE Developer Community Program Lead

4 年

This is nice

要查看或添加评论,请登录

社区洞察

其他会员也浏览了