Host static website using S3 service of AWS
In this blog, we are going to learn how to host your static website using AWS S3 service, so without wasting time lets get started with this blog.
Step 1: First create a basic HTML page, I created in a notepad just to show you guys.
Step 2: After finishing writing your HTML code save your page.
Step 3: As you can see in the below image how to save your HTML page, I am saving on my desktop. make sure the name you will give to your page it should standard name like here I give index.html, it is not compulsory but this is a suggestion.
Step 4: Check your page by running it with Google chrome if it is working or not before hosting your page.
Step 5: So you can see our HTML page is working properly, so now we are ready to host our page.
Step 6: Go to AWS Console login and choose the first link to login to your AWS console.
Step 7: enter your Email and Password to sign in to your console.
Step 8: Now you are in your dashboard so go to services and choose the service you want to use, we are going to use S3 to host, so select S3 from storage option.
Step 9:For Creating your bucket, select create bucket option.
Step 10: Enter your bucket name and click on next.
Step 11: As you can see in the below image ignore all these things and click on the Next button.
Step 12: To give the public access to your bucket uncheck the block public access box and click on next.
Step 13: Review your bucket and after that click on create bucket.
Step 14: Now you can see your bucket is created, select your bucket, and click on your bucket name.
Step 15: you can see details of your bucket and now we have to upload our HTML page to our bucket so click on the upload button.
Step 16: After selecting your HTML page either you can directly click on the upload button to upload it or you can click on next if you want to do the further configuration of your HTML page.
Step 17: You can see your HTML page is uploaded to the bucket.
Step 18: Now you have to click on properties option above your upload button.and after that select static website hosting to enable it.
Step 19: Choose the first radio button use this bucket to host option, and write your HTML page name as you can see in the below image.
Step 20: After that click on the save button.
Step 21: On the top, you can see the URL of your hosted page, you can see in the below image, click on the link.
Step 22: But the link will show you an error because you have to give permission, so go to permissions and click on bucket policy.
Step 23: paste the bucket policy there and write the name of your bucket as marked in the above image, and click on the save button, after that again refresh you URL and you can see your HTML page hosted there.
Congratulations your website is hosted on your S3 bucket. now you can host as many websites as you want.
In the next blog, we are going to learn the S3 glacier service. thank you for reading.