Skip to main content

Command Palette

Search for a command to run...

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

Updated
β€’3 min read

πŸš€ 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)
  5. 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/*"
    }
  ]
}
  • 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


E

Thanks for this guide! I just tried hosting a small portfolio on S3 and your steps made it so much easier. I didn’t realize how important the bucket policy was until I ran into access issues. One thing I’ve learned β€” pairing S3 with CloudFront really makes sites faster, especially when you have images or multiple pages.

Mastering Git and GitHub

Part 2 of 6

A beginner-friendly series that takes you from the basics of version control with Git to advanced collaboration workflows on GitHub. Perfect for students, developers, and anyone looking to understand modern software development practices.

Up next

GitHub Branch Protection Rules: Why and How to Use Them

πŸš€ Introduction When working on projects with multiple developers, maintaining code quality and stability becomes critical. That’s where branch protection rules come in. Branch protection rules in GitHub allow repository admins to enforce certain wor...

More from this blog

TechEazy Consulting

34 posts