AWS Builder Center
Your First Cloud Project: A Beginner's Guide to Hosting a Website on AWS S3

Your First Cloud Project: A Beginner's Guide to Hosting a Website on AWS S3

Learn the basics of web hosting and deploy your very first website to the cloud using Amazon S3. This step-by-step, beginner-friendly guide includes a free interactive digital card template to help you get started!

Your First Cloud Project: A Beginner's Guide to Hosting a Website on AWS S3

By Chandrabhan Choudhary, AWS Student Builder Group Leader at LNCT
If you are a first or second-year student, you have probably heard buzzwords like "The Cloud," "AWS," and "Deployment" thrown around a lot. It can sound intimidating, but it is actually much simpler than you think!
Recently, our AWS Student Builder Group at LNCT hosted an event called "From Code to Cloud" to help beginners launch their very first cloud project. If you missed it, don't worry. This guide will walk you through exactly how websites work and how to get your own project live on the internet using Amazon S3.

🤔 What exactly is a website?

Before we put a website on the internet, let's look at how it is built. A website is basically a group of web pages stored on a computer.
It is built using three main languages:
  • HTML (Structure): The skeleton of the page.
  • CSS (Style): The design, colors, and layout.
  • JavaScript (Action): The interactive parts, like buttons that actually do things.
We also split websites into two parts: the Frontend and the Backend. Think of a restaurant: The frontend is the dining area where you sit, look at the menu, and eat. The backend is the kitchen hidden in the back, where all the cooking and processing happens. When you click a button on your phone (the Client), it sends a request to the kitchen (the Server), which then sends back your data.

💻 Why do we need "Hosting"?

If you write some HTML code on your laptop right now, it will open in your browser. But it is running on "localhost," which means it only works on your own laptop. If you send that link to your friend, it will just show them an error!
To let other people see your website, you need Hosting. Hosting just means renting a computer that is always turned on and connected to the internet. Instead of buying our own expensive servers, we use Amazon Web Services (AWS) to rent them over the internet, paying only for what we actually use.

🪣 Meet Amazon S3

AWS has a ton of different services, but today we are using Amazon S3 (Simple Storage Service). S3 is designed to store files safely and cheaply, and it can even host a simple static website for you.
Here are the only two S3 words you need to know:
  • Bucket: Think of this as the main folder for your project.
  • Object: These are just the files (like your HTML and image files) that you upload into your bucket.



🎁 Step 0: Your Free "Cloud Builder" Template

Don't have a website ready yet? No problem! We have built a custom digital card just for you.
  1. Open Notepad (Windows) or TextEdit (Mac).
  1. Copy and paste the code below.
  1. Find the  [Your Name]  placeholder in the code and change it to your actual name.
  1. CRITICAL SAVE STEP: Go to  File > Save As . Change the "Save as type" dropdown to All Files (if you don't do this, it will save as a  .txt  text file and won't work!).
  1. Name the file exactly:  index.html 
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>My First Cloud Deployment</title>
<style>
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: #0f111a; color: #ffffff; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; }
.card { background: linear-gradient(145deg, #1e2233, #161925); padding: 50px 40px; border-radius: 20px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); text-align: center; border: 1px solid #333; transition: transform 0.3s ease; }
.card:hover { transform: translateY(-5px); box-shadow: 0 0 25px rgba(255, 153, 0, 0.4); border-color: #ff9900; }
.icon { font-size: 60px; margin-bottom: 15px; }
h1 { color: #ff9900; margin: 0 0 15px 0; font-size: 32px; }
p { color: #aab; font-size: 18px; margin-bottom: 25px; }
.author { font-size: 16px; color: #889; margin-bottom: 35px; }
.author span { color: #fff; font-weight: bold; }
.btn { background-color: #ff9900; color: #111; border: none; padding: 14px 28px; font-size: 16px; font-weight: bold; border-radius: 8px; cursor: pointer; transition: background 0.3s; }
.btn:hover { background-color: #e68a00; }
</style>
</head>
<body>
<div className="card">
<div className="icon">☁️🚀</div>
<h1>Hello, Cloud!</h1>
<p>I successfully deployed my first website on Amazon S3.</p>
<div className="author">Built by: <span>[Your Name]</span></div>
<button className="btn" onclick="alert('🚀 Whoosh! Your website is live on the internet. Welcome to the cloud!')">Launch Deployment</button>
</div>
</body>
</html>


🚀 Let's Build: Deploy Your Website in 6 Steps!

Ready to get your first website on the internet? Let's do it!
Step 1: Create a bucket Log into the AWS Console, search for S3, and click Create bucket. Give it a cool, unique name.
💡 Wait, why does the name have to be unique? Bucket names are shared across all AWS users globally! If someone else in the world named their bucket  my-cool-website , you can't use it. Try adding your name or some numbers to the end.
Step 2: Turn off the locks (Allow public access) By default, AWS keeps your files super private. Scroll down to the Block Public Access section, uncheck the box that says Block all public access, and acknowledge the warning. Click Create bucket.
Step 3: Upload your files Click on your new bucket name in the list and hit Upload. Click "Add files", select the  index.html  file you made earlier, and click the Upload button at the bottom.
Step 4: Add a bucket policy Go to the Permissions tab of your bucket, scroll down to Bucket policy, and click Edit. Paste in this exact code (but make sure to replace  YOUR-BUCKET-NAME  with your actual bucket name!):
JSON
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::YOUR-BUCKET-NAME/*"
}
]
}
💡 Wait, why do I need a policy if I already unlocked the bucket in Step 2? Think of Step 2 like unlocking the front door of an office building. People can enter, but the security guard will still stop them. Step 4 is like giving the security guard a VIP guest list that says "let everyone in to read these files!"
Step 5: Turn on website hosting Go to the Properties tab and scroll all the way to the bottom. Edit the Static website hosting setting, choose Enable, and type in  index.html  as your index document. Save the changes.
Step 6: Open your live link! Scroll back down to the bottom of the Properties tab. You will now see a Bucket website endpoint link. Click it, and boom! Your website is officially live on the internet for anyone in the world to see.

🧹 Cleaning Up (Avoiding Charges)

Once you are done showing off your website, you should delete it so you don't accidentally get charged for storage in the future.
  1. Go back to your bucket list in S3.
  1. Select your bucket and click Empty. (You have to type "permanently delete" to confirm).
  1. Once it is empty, select the bucket again and click Delete. (You will have to type your bucket name to confirm).
Welcome to the Cloud! ☁️ Deploying your very first website to a public URL is a massive milestone. Try it out, and drop your S3 website link in the comments below so we can see what you built!
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article