The AWS console can look intimidating, but it has one simple trick: always use the search bar at the top center of the screen. Instead of hunting through complex menus, just type the name of the service you need (e.g. "S3", "Route 53") and click the first result under the "Services" category.
1Prerequisites
Before we start, let's review what we're trying to accomplish and what you'll need ready. We'll assume you already have your website (HTML, CSS, and possibly image folders) saved on your computer.
| Project goals | What you need |
|---|---|
|
|
2Create and Configure an S3 Bucket
The first step is creating the "container" where your website's files will live. In the AWS ecosystem, this file container is called an S3 Bucket.
1. Create the bucket
Sign in to the AWS console. In the top search bar, type S3 and click the first result. Once inside S3, look for a large orange "Create bucket" button and click it.
On the next screen, follow these rules:
- Bucket name: Give it a name. Golden rule: the name must be globally unique (no one else on AWS can already be using it). Use only lowercase letters, numbers, and hyphens, no spaces (e.g.
my-website-2026). - AWS Region: Select the region geographically closest to you or your users (e.g.
us-east-1orus-west-2).
2. Allow public access
By default, AWS blocks all access to your files so no one on the internet can view them. Since we want a public website, we need to remove this lock.
On that same screen, scroll down to the "Block Public Access settings for this bucket" section:
- Uncheck the main box that says "Block all public access."
- Unchecking it reveals a yellow warning box. Check the small box in that warning to confirm you understand your files will be public.
- Scroll to the very bottom of the page and click the orange "Create bucket" button.
3. Configure as a static website
You'll now see a list with your newly created bucket. Click its name (in blue text) to open it. At the top you'll see several tabs (Objects, Properties, Permissions...). Click the "Properties" tab.
- Scroll to the very bottom of the page until you find the "Static website hosting" section.
- Click "Edit."
- Select "Enable."
- In the "Index document" field, type exactly
index.html(this will be your website's main file). - Scroll down and click "Save changes."
4. Add the Permissions Policy (Bucket Policy)
Even though you removed the general lock, you need to explicitly tell S3 to let web browsers "read" your files. Go to the top tab called "Permissions."
- Scroll down a bit to the "Bucket policy" section and click "Edit."
- You'll see a blank text box. Paste exactly the following code there.
- Careful! You need to delete
YOUR-BUCKET-NAMEand type the exact name you gave your bucket in step 1.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::YOUR-BUCKET-NAME/*"
}
]
}
Click "Save changes." If everything worked, the Permissions tab will show a red badge that says "Publicly accessible."
3Upload Your Files to S3
Now that your "container" is ready to act as a web server, let's upload the files from your computer.
- Inside your bucket, click the first tab called "Objects."
- Click the orange "Upload" button.
- Here you can drag and drop your website's files and folders straight from your computer into the box on screen. Alternatively, use the "Add files" button (for individual files like your
index.html) or "Add folder" (for folders likecssorimages). - Once you see all your files listed on screen, scroll down and click the orange "Upload" button at the bottom.
- Wait for the progress bar to finish and a green success message to appear. Then click "Close" in the top right.
4Get and Share Your Free Public Link
Congratulations! At this point, your website is already live on the internet. You don't need to buy a domain or configure anything else if your only goal is sharing your page with friends, professors, clients, or for your portfolio.
AWS automatically gives you a free URL tied directly to your bucket. Here's how to find it to share:
- Make sure you're inside your bucket in the AWS console.
- Click the "Properties" tab (the second tab at the top).
- Scroll with your mouse wheel all the way to the very bottom of that page.
- Find the section called "Static website hosting."
- Under the text "Bucket website endpoint," you'll see a blue link. It'll look something like:
http://your-bucket-name.s3-website-us-east-1.amazonaws.com. - Click that link. A new tab will open in your browser showing your website! Copy that address from your browser's bar and send it to anyone you'd like.
You'll notice two things about this link: it's a bit long, and it starts with http:// instead of https:// (so the browser may say "Not secure"). This is completely normal and safe for static sites that don't request passwords or credit cards. It's the fastest, free way to publish on the web!
For the practical purposes of this lesson, the link you got in Step 4 already gives you a website ready to share. If you don't want to spend money on a custom domain (like mydomain.com) or set up complex technical configuration in AWS, you can jump straight to the "Verification" section at the end of this page.
Steps 5 through 8 are advanced and completely optional. They're kept here as a reference guide in case you decide, in the future, to give your website a paid custom domain and bank-grade encryption (HTTPS) using CloudFront and Route 53.
5Prepare Your Domain with Route 53 (Optional)
If you want your site to have an address like mydomain.com, we'll use AWS's Route 53 service to connect a domain you've already purchased through an external registrar (GoDaddy, Namecheap, etc.).
- Use the AWS top search bar, type Route 53, and click the service.
- In the left-hand menu (if hidden, click the three-line/hamburger icon), find and click "Hosted zones."
- Click the orange "Create hosted zone" button.
- In the "Domain name" field, type your domain name (no www, just
mydomain.com). Make sure the type below says "Public hosted zone" and click "Create hosted zone" below. - The vital step: In the table that appears on screen, find the row where the "Type" column says NS (Name Servers). In the right-hand column ("Value"), you'll see 4 internet addresses ending in
.com,.net, etc. Copy those 4 addresses. - Open a new tab in your browser, go to the site of the company where you bought your domain (GoDaddy, Namecheap, etc.) and find the DNS or Nameservers settings. Replace the company's defaults by pasting in the 4 AWS gave you. (Note: AWS sometimes adds a trailing period to each address; remove it if your domain provider won't let you save them with the trailing period).
6Get an SSL Certificate (Optional)
To make your domain show the secure-site lock icon (HTTPS), we'll get a free certificate through AWS Certificate Manager (ACM).
For this certificate to work globally with CloudFront, you MUST request it in the Virginia region. In the top-right corner of the AWS console (right next to your username), you'll see a city or region name. Click it and select US East (N. Virginia) us-east-1 before continuing.
- Use the top search bar, type Certificate Manager, and enter the service.
- Click "Request a certificate," choose "Request a public certificate," and press Next.
- Under "Fully qualified domain name," type your domain name (e.g.
mydomain.com). - Leave the validation method on "DNS validation" and click "Request" below.
- You'll see a list of certificates and yours will say Pending validation. Click your certificate's ID (the blue numbers/letters) to open its details.
- Find the "Domains" section partway down the page. To the right you'll see a button that says "Create records in Route 53." Click it, then click the orange "Create records" button. This automatically creates a special record proving to AWS that you own the domain.
Now be patient. Wait a few minutes (it can take 5–30 minutes) until the certificate's status turns from blue to green and says "Issued."
7Make the Site Fast and Secure with CloudFront (Optional)
S3 by itself doesn't know how to use your new security certificate. We'll use CloudFront, a service that copies your page onto servers around the world, wrapping it with your secure certificate.
- Use the top search bar, type CloudFront, and enter the service. Click "Create a CloudFront distribution."
- In the "Origin domain" field, click the blank box. A dropdown will appear; select your S3 bucket. (Ignore any yellow warning recommending "OAC" — for this public static site we don't need it.)
- Scroll down to the "Default cache behavior" section. Under "Viewer protocol policy," select "Redirect HTTP to HTTPS."
- Very important! Scroll down to find the "Web Application Firewall (WAF)" section. Make sure you select "Do not enable security protections." If you enable the firewall without realizing it, AWS could charge you unexpected monthly fees for an advanced protection service you don't need for a simple static site.
- Keep scrolling to the "Settings" section.
- Under "Alternate domain name (CNAME)," click "Add item" and type your domain (e.g.
mydomain.com). - Under "Custom SSL certificate," click the box and select the certificate you created in step 6 (if it doesn't appear, make sure you waited for it to say "Issued" in Virginia).
- In the final "Default root object" field, type
index.html. - Click "Create distribution" at the bottom of the page.
You'll see a banner at the top saying the distribution is "Deploying." Note the URL under the "Distribution domain name" section (a long link ending in .cloudfront.net). This process can take about 10 minutes.
8Connect Your Final Domain to CloudFront (Optional)
The last step is telling your domain (already managed by Route 53) that when someone types your web address, it should be routed to CloudFront's fast network.
- Search the top bar again for Route 53 and go into "Hosted zones."
- Click your domain's name.
- Click the orange "Create record" button.
- Make sure "Record type" is set to A - Routes traffic to an IPv4 address.
- To the right of the "Value" field, turn on the small "Alias" toggle.
- A field called "Route traffic to" will appear. Click the first box and choose "Alias to CloudFront distribution."
- In the search box that appears just below, paste the long CloudFront URL you copied in the previous step (the one ending in
.cloudfront.net). - Click the "Create records" button.
Done! Internet systems (DNS) can take anywhere from 5 minutes to a couple of hours to update worldwide. Soon, typing your own domain into a browser will load your website instantly, with its security lock active.
Optional: Automate Uploads with GitHub Actions (Advanced)
Note: this section is only for technical readers who already use version control. If you don't know what Git or GitHub are, feel free to skip it entirely — you can keep updating your page any time by simply repeating Step 3 (the "Upload" button).
If you're a developer, you can have GitHub push changes to S3 automatically every time you run a git push.
1. IAM credentials
Go to the AWS IAM console and create a User with programmatic access. Instead of using a broad policy like AmazonS3FullAccess (which grants access to every bucket in your account), create an inline policy scoped only to your bucket, using the following JSON — replace YOUR-BUCKET-NAME with the real name:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": ["s3:PutObject", "s3:GetObject", "s3:ListBucket", "s3:DeleteObject"],
"Resource": [
"arn:aws:s3:::YOUR-BUCKET-NAME",
"arn:aws:s3:::YOUR-BUCKET-NAME/*"
]
}
]
}
When done, copy its Access Key ID and Secret Access Key. In your GitHub repository, go to Settings > Secrets and variables > Actions, and save them as two new "Repository secrets" named AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.
2. Workflow file
On your computer, at the root of your project, create the hidden folders .github/workflows and inside create a file called main.yml. Paste the following code, making sure to change the region and your bucket name:
name: Deploy to S3
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1 # Change this to your bucket's region
- name: Deploy static site to S3
run: aws s3 sync ./ s3://YOUR-BUCKET-NAME --delete
Commit and push. On GitHub's "Actions" tab you'll see the deployment to S3 run automatically.
Verification
Related Resources
- Amazon S3 — Service portal
- AWS Documentation — Static website hosting
Lesson complete
Congratulations! You've built real cloud infrastructure. Your website no longer lives only on your computer — it's now fast, secure, and reachable by anyone in the world through your own domain, running just like a professional site.