DEV Community

TechEazy Consulting
TechEazy Consulting

Posted on

How to Host a Static Website on AWS S3 (Step-by-Step Guide)

๐Ÿš€ Introduction

If youโ€™ve built a static website using HTML, CSS, and images, the next step is getting it online. One of the simplest and most cost-effective ways is to use Amazon S3 (Simple Storage Service).

With just a few clicks, you can deploy your static site and make it accessible to the world โ€” no servers required!

Letโ€™s go step by step.


๐Ÿ›  Step 1: Prepare Your Files

Make sure your project folder contains all necessary files, such as:

  • index.html
  • style.css
  • Any images or assets

๐Ÿ‘‰ Keep them organized in a single folder before uploading.


๐Ÿงฉ Step 2: Create an S3 Bucket

  1. Log in to AWS Management Console โ†’ S3
  2. Click Create bucket
  3. Enter a unique bucket name (example: portfolio-website)
  4. Uncheck Block all public access if you want your site to be public
  5. Click Create bucket

โš™๏ธ Step 3: Configure Bucket for Static Website Hosting

  1. Open your newly created bucket
  2. Go to the Properties tab
  3. Scroll to Static website hosting โ†’ Edit
  4. Enable it and set:
  • Index document โ†’ index.html
  • Error document โ†’ 404.html (optional)
    1. Save changes

๐Ÿ”“ Step 4: Make Files Public

There are two ways to allow public access:

Option 1: Manually

  • Select all objects โ†’ Click Actions โ†’ Make public

Option 2: Bucket Policy (Recommended)

  • Go to Permissions โ†’ Bucket Policy
  • Paste the following JSON (replace YOUR_BUCKET_NAME):
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "PublicReadGetObject",
      "Effect": "Allow",
      "Principal": "*",
      "Action": "s3:GetObject",
      "Resource": "arn:aws:s3:::YOUR_BUCKET_NAME/*"
    }
  ]
}
Enter fullscreen mode Exit fullscreen mode
  • Save changes

๐Ÿ“ค Step 5: Upload Your Files

  1. Go to the Objects tab
  2. Click Upload โ†’ Add files
  3. Select all your project files (index.html, style.css, images, etc.)
  4. Click Upload

๐ŸŒ Step 6: Access Your App

  1. Open the Properties tab of your bucket
  2. Scroll to Static website hosting
  3. Copy the Bucket website endpoint URL
  4. Paste it into your browser โ€” your site is live ๐ŸŽ‰

๐ŸŽฏ Conclusion

Hosting a static website on AWS S3 is one of the fastest ways to make your portfolio, landing page, or small project available online.

Itโ€™s cost-efficient, secure, and scalable โ€” making it perfect for developers of all levels.

โœ… Next Steps

๐Ÿš€ Be interview-ready in the era of AI & Cloud โ€” start your DevOps journey today!

๐Ÿ’ก YouTube wonโ€™t get you a job. Real projects + real internship certificate will.

๐Ÿ”ฅ AI is reshaping jobs. Donโ€™t watch it happen, be part of it with DevOps & Cloud skills.

๐ŸŽฏ โ‚น2000/month today = Dream job tomorrow. Secure your spot now.

โณ Every month you wait, Cloud + AI jobs are being filled. Donโ€™t miss out!

๐ŸŒ DevOps + AWS + AI = The skillset every recruiter is hunting for in 2025.

๐Ÿ‘‰ Register now at TechEazy Consulting


Top comments (0)