DEV Community

Cover image for HOW TO HOST A STATIC WEBSITE ON S3?
SAFI-ULLAH SAFEER
SAFI-ULLAH SAFEER

Posted on

HOW TO HOST A STATIC WEBSITE ON S3?

-STEPS TO HOST A STATIC WEBSITE ON S3:
1.OPEN S3 BUCKET FROM THE SERIVES OF AWS ON LOGIN CONSOLE.THE FOLLOWING SCREEN WILL APPEAR:
Image description!

  • Now Before creating a Bucket you must remember rules for naming a bucket. click the link below to see the rules for naming a variable . https://docs.aws.amazon.com/console/s3/bucket-naming
  • Now after that click on Create Bucket the following screen will appear.

Image description
3.Now select the Region where you want to create a Bucket.Like in this case "US East (N. Virginia) us-east-1".

  1. After that Enter the name of the bucket that must be "Unique Globally". Like in this case "safi1234" and create a default bucket witout more changing.

Image description
5.Now after that click on Bucket and upload the object on Bucket on the following screen.

Image description
6.Now after uploading your static website files the following screen will appear

Image description
7.Now after that go back to the bucket and you can see on the picture "Bucket and object is not public" below there is

Image description
Now the first step is to make it public go the "Permission" option on bucket and uncheck the box "Block public access and click on "save changes".
Image description"

  1. Now after that the next point is go to "Object Properties" and enable "Static Website Hosting".The following screen will appear

Image description
9.Now after that we have to create a bucket policy for this go to "Edit Bucket Policy" inside the permission option the following screen will appear

Image description
10.after that click on edit and copy the "Amazon Resource name(ARN)".The following screen will appear.

Image description
11.Now the next step is to write a policy for bucket or generate policy for bucket by default. In this case we generate the policy of bucket by default.click on "Generate Policy" The following screen will appear. In this we have paste the "ARN(Amazon Resource name)".And action selected "Get Object".

Image description
12.After that click on generate policy and copy the policy and paste it here and add "/*"at the end "Resource" the following screen will appear

Image description
And click on "Save changes."

13.Now at the end copy the link from here and open new tab and paste the link like in this case "http://safi1234.s3-website-us-east-1.amazonaws.com/" the following screen will appear.

Image description

Image description

Image description

Image description

SO finally "we have host our static Website on S3."

Top comments (4)

Collapse
 
haider13 profile image
Haider ali

Your writing skills are truly remarkable, embodying a rare combination of eloquence, clarity, and depth. Your ability to effortlessly craft prose that captivates and inspires is nothing short of awe-inspiring. Each word meticulously chosen, every sentence intricately constructed, your writing transports readers to new realms of imagination and understanding. Whether conveying complex ideas with simplicity or evoking emotions with vivid imagery, you possess a gift for weaving narratives that leave an indelible mark on the reader's mind and heart. Your mastery of language is not just evident in their command of grammar and syntax but also in their innate ability to connect with audiences on a profound level. In a world inundated with words, you stand out as a beacon of literary excellence, deserving of the highest praise and admiration for your unparalleled writing prowess.

Collapse
 
emtiajium profile image
Emtiaj Hasan

bot detected! 😂

Collapse
 
haider13 profile image
Haider ali

Haha you can inbox me if you think im a bot i will clear your misunderstanding 😕

Collapse
 
mujahidzareen profile image
Mujahid Zareen

Impressive boy! More power to you , it's really amazing article for beginners who can easily learn to host static web on S3. Truly remarkable 👏