In this blog, we will discuss a practical approach for hosting a website on S3 without getting lost in the sea. In 5 easy steps, you can successfully launch a website on Amazon S3 (Simple Storage Service) successfully.
-
Name the S3 Bucket
Before you start hosting a website on S3, you need a bucket first. Make sure that the bucket has the same name as the domain name. If your website name is https://intertoons.com/ then the domain name would also be the same.
-
Configure the S3 Bucket
Turning on static website hosting for the S3 bucket is as simple as a few clicks in the AWS Console.
- In the AWS Console, go to the S3 option.
- Click into the bucket and browse the “Properties” Tab.
- Here, you can see the “static website hosting” option.
- Moving ahead, choose the “Use this bucket to host a website” option.
- Now, add “index.html” to access the Index file.
Now, you have configured the bucket for a static website hosting, got an S3 URL and it is even accessible to the world. In the next step, we will tell you how to provide a mapping from domain name to the S3 website URL so that users can quickly load your S3 website.
-
Add a CNAME record to the Bucket URL
To provide a mapping from domain name to the S3 website URL, you have to add a CNAME record within DNS records. There is not a single process to complete this step but it may vary based on your DNS provider.
-
Upload the Static Website
You have configured the S3 bucket, added a CNAME record and got the S3 URL? Awesome, it is the showtime now. You have to upload the static website to the newly configured S3 website bucket now. Here are a few steps on how to complete this process using the AWS Console.
- In the AWS Console, go to the S3 option.
- Click into the bucket and choose the “Upload” option.
- Drag or drop files or you can even add an entire static website directory.
- Click Next and add permissions.
- Click Next then Upload button in the end.
These are a few simple steps that can be converted to one command line operation with the help of experts
-
Make Validation
In the end, you just have to validate either static website is uploading from the S3 bucket successfully or not.
With these five easy steps, you can host a static website seamlessly without getting lost in the sea. The major benefits of this hosting are the low-cost operation, highly secure, easy to maintain or scale, etc.