Deploying a Portfolio Website with AWS S3
This guide walks through creating an S3 bucket, uploading a static portfolio site (index.html), and configuring it for public web hosting.
Prerequisites
An AWS account
Your website files (index.html and any images/assets)
Step 1: Create an S3 Bucket
Sign in to the AWS Management Console.
Open the S3 service.
Click Create bucket.
Enter a bucket name. This must be globally unique across all AWS accounts (e.g. yourname-portfolio).
Choose an AWS Region close to you or your target audience.
Under Block Public Access settings, leave the defaults for now — this will be adjusted in Step 4.
Leave other settings at their defaults and click Create bucket.
Step 2: Upload Your Files
Open the newly created bucket.
Click Upload.
Click Add files and select index.html (and any images used by the page).
Click Upload to complete.
Step 3: Enable Static Website Hosting
Open your bucket, go to the Properties tab.
Scroll down to Static website hosting and click Edit.
Select Enable.
Set:
Index document: index.html
Error document: index.html (or a custom error page if you have one)
Click Save changes.
AWS will display a bucket website endpoint URL (e.g. http://your-bucket-name.s3-website-.amazonaws.com). Note this down.
Step 4: Allow Public Read Access
Static hosting requires the files to be publicly readable.
Go to the Permissions tab.
Under Block public access (bucket settings), click Edit.
Uncheck Block all public access and confirm.
Under Bucket policy, click Edit and add the following policy (replace your-bucket-name):
json
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::your-bucket-name/"
}
]
}
Click Save changes.
Note: This makes every object in the bucket publicly readable. If the bucket contains files unrelated to the website, consider using a dedicated bucket or scoping the policy to a specific folder/prefix instead.
Step 5: Test the Website
Go back to Properties → Static website hosting.
Open the bucket website endpoint URL in a browser.
Confirm the portfolio loads correctly, including the image.
Step 6 (Optional): Custom Domain and HTTPS
Plain S3 static website hosting only supports HTTP, not HTTPS, and doesn't support a custom domain directly. To add both:
Create a CloudFront distribution with the S3 bucket (or its website endpoint) as the origin.
Request or import an SSL/TLS certificate via AWS Certificate Manager (must be in the us-east-1 region for CloudFront).
Attach the certificate to the CloudFront distribution.
In Route 53 (or your domain registrar), point your domain's DNS record to the CloudFront distribution.
Updating the Site Later
To publish changes, upload the updated index.html (and any changed assets) to the same bucket, overwriting the existing files. If using CloudFront, you may need to invalidate the cache for changes to appear immediately:
Go to your CloudFront distribution.
Open the Invalidations tab.
Create an invalidation for /* to clear the cache.


Top comments (0)