AWS Builder Center
How to Host a Static Portfolio Site on AWS S3 & CloudFront for Free (Student Guide ๐Ÿš€)

How to Host a Static Portfolio Site on AWS S3 & CloudFront for Free (Student Guide ๐Ÿš€)

Learn how to deploy a secure, low-latency static site using S3 and CloudFront while keeping your storage private through Origin Access Control. This hands-on, Free-Tier-friendly guide walks you step-by-step through setting up your first production-ready web hosting architecture.

How to Host a Static Portfolio Site on AWS S3 & CloudFront for Free (Student Guide ๐Ÿš€)

As a student breaking into cloud computing, building projects is greatโ€”but showcasing them properly is what catches the eye of recruiters.
In this quick hands-on tutorial, we will take a simple HTML/CSS portfolio and host it globally using Amazon S3 for storage, Amazon CloudFront as a CDN (Content Delivery Network), and AWS IAM to enforce least-privilege security.
Best of all? It fits 100% within the AWS Free Tier.

๏ปฟ

๐Ÿ—๏ธ Architecture Overview

Here is how traffic flows when a user visits your site:
User Request โ”€โ”€โ–บ Amazon CloudFront (Edge Location) โ”€โ”€โ–บ S3 Bucket (Private Origin Access Control)
๏ปฟ
  1. Amazon S3: Holds our static site files (HTML, CSS, JS, images).
  1. Amazon CloudFront: Caches our content globally so it loads fast anywhere.
  1. Origin Access Control (OAC): Secures our S3 bucket so people can only view the site through CloudFrontโ€”not by accessing the S3 URL directly.

๏ปฟ

Step 1: Create a Private S3 Bucket

  1. Open the Amazon S3 Console and click Create bucket.
  1. Give your bucket a globally unique name (e.g., ย my-student-portfolio-2026ย ).
  1. Under Block Public Access settings, leave "Block all public access" checked.
๐Ÿ’ก Best Practice Tip: Keep your bucket private! We will grant access via CloudFront securely using OAC rather than exposing the bucket to the public web.
  1. Leave all other defaults and click Create bucket.
  1. Upload your site files (ย index.htmlย , ย style.cssย , etc.) into your new bucket.

๏ปฟ

Step 2: Set Up Amazon CloudFront CDN

  1. Open the CloudFront Console and click Create distribution.
  1. In the Origin domain field, select your S3 bucket from the dropdown.
  1. Under Origin access, choose Origin access control settings (recommended):
  • Click Create control setting and hit Create.
  1. Scroll down to Default root object and type ย index.htmlย .
  1. Click Create distribution.

๏ปฟ

Step 3: Apply the S3 Bucket Policy

CloudFront needs permission to pull files from your S3 bucket.
  1. Once your distribution is created, click the banner at the top that says "Copy policy".
  1. Go back to your S3 Bucket โ”€โ”€โ–บ Permissions tab โ”€โ”€โ–บ Bucket Policy โ”€โ”€โ–บ Click Edit.
  1. Paste the policy you copied from CloudFront and click Save changes.
Your bucket policy will look similar to this:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowCloudFrontServicePrincipalReadOnly",
"Effect": "Allow",
"Principal": {
"Service": "cloudfront.amazonaws.com"
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::my-student-portfolio-2026/*",
"Condition": {
"StringEquals": {
"AWS:SourceArn": "arn:aws:cloudfront::YOUR_ACCOUNT_ID:distribution/YOUR_DISTRIBUTION_ID"
}
}
}
]
}
๏ปฟ

๏ปฟ

Step 4: Test Your Live Site! ๐ŸŒ

  1. Go to your CloudFront distribution details page.
  1. Copy the Distribution Domain Name (it looks like ย d111111abcdef8.cloudfront.netย ).
  1. Paste it into your browser tab.
๐ŸŽ‰ Congratulations! Your site is now served globally through AWS CloudFront.

๏ปฟ

๐Ÿ’ก Core Takeaways & Next Steps

  • Security First: We never made the S3 bucket public. Using OAC ensures that traffic must pass through CloudFront.
  • Zero Cost: The S3 and CloudFront allocations fall well within the free allowance for personal sites.
  • Next Level Challenge: Try adding a custom domain name using Amazon Route 53 and securing it with an SSL certificate using AWS Certificate Manager (ACM)!

๏ปฟ
๐Ÿ’ฌ If you found this student guide helpful, please drop a Like / Upvote below! Let me know in the comments what AWS services you're currently exploring. ๐Ÿš€

๏ปฟ
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