For More Info!

How To Host Website On AWS S3? Step By Step Guide
To host a static website on AWS S3, follow these steps:
Step 1: Create an S3 Bucket
- Login to AWS Management Console:
- Go to the S3 service in the AWS Management Console.
- Create a New Bucket:
- Click on Create bucket.
- Provide a unique Bucket name (this name must be globally unique).
- Select the Region where you’d like to host the bucket.
- Click on Create bucket.


Step 2: Upload Your Website Files
- Open your newly created bucket.
- Click on the Upload button.
- Add all your static files (HTML, CSS, JavaScript, images, etc.).
- Click Upload to finish the process.

Step 3: Enable Static Website Hosting
- In the S3 console, navigate to your bucket.
- Click on the Properties tab.
- Scroll down to Static website hosting.
- Click on Enable.
- Specify the following:
- Index document: Enter the filename of your homepage, typically
index.html
. - Error document (optional): Enter the filename for error pages, typically
error.html
.
- Index document: Enter the filename of your homepage, typically
- Click Save changes.
Step 4: Set Permissions
- Go to the Permissions tab of your bucket.
- Click on Bucket policy and add the following policy to allow public access to your files:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::YOUR-BUCKET-NAME/*"
}
]
}
Replace YOUR-BUCKET-NAME
with the name of your S3 bucket.
3. Click Save.
Note: This policy makes the contents of the bucket publicly accessible. Ensure that no sensitive information is stored in the S3 bucket.
Step 5: Access Your Website
- Once the static website hosting is enabled, you will see a Bucket Website Endpoint in the Static website hosting section.
- Use this endpoint to access your website. It will look like:
http://YOUR-BUCKET-NAME.s3-website-YOUR-REGION.amazonaws.com
Step 6 (Optional): Use a Custom Domain with Route 53
- To use a custom domain (e.g.,
www.example.com
), you can configure DNS settings using Amazon Route 53. - Create a CNAME record that points to the S3 website endpoint.
- You may need to configure SSL/TLS (using AWS Certificate Manager) and CloudFront for HTTPS access.

That’s it! Your static website is now hosted on AWS S3.