Building and Hosting Your Own Portfolio Website: A Complete Guide
Update, October 2026: I've since redesigned the site with a new look, but the hosting setup in this guide hasn't changed. It still runs on S3, CloudFront and Cloudflare.
Introduction
Hey there! If you're reading this on my portfolio website, you might be wondering how I built it and got it online. Well, I'm going to walk you through the entire process from writing the first line of code to making it accessible to the world. Whether you're transitioning careers like me or just want to showcase your work, having your own website is incredibly valuable - and it's easier (and cheaper) than you might think!
Why Build Your Own Portfolio?
When I started my transition from insurance to IT, I knew I needed a way to showcase my technical skills beyond just listing them on a resume. Building my own website from scratch serves multiple purposes:
- It demonstrates actual coding ability
- Shows initiative and self-directed learning
- Provides a platform to share projects and blog posts
- Gives me complete control over my online presence
- Costs almost nothing to maintain (seriously, we're talking pennies per month)
The Tech Stack I Chose
For this project, I kept things simple but modern:
- HTML5 for structure
- CSS3 with custom animations and glassmorphism effects
- Vanilla JavaScript for interactivity (no frameworks needed!)
- AWS S3 for hosting
- CloudFront for CDN and HTTPS
- Cloudflare for DNS management and security
- Porkbun for domain registration
Step 1: Planning the Website
Before writing any code, I sketched out what I wanted:
- A clean profile section introducing myself
- Sections for certifications, skills, and projects
- A technical blog to share my learning journey
- Interactive modals for detailed project information
- Mobile-responsive design
Pro tip: Don't overthink this stage. Your website will evolve as you build it!
Step 2: Building the Website
I started with a basic HTML structure and gradually added features:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Your Name - Portfolio</title>
</head>
<body>
<!-- Start simple, then add complexity -->
</body>
</html>
The key was building incrementally:
- First, get the content on the page
- Then make it look good with CSS
- Finally, add interactivity with JavaScript
For the design, I went with a modern glassmorphism aesthetic - those frosted glass effects you see everywhere. It's trendy but also timeless enough that it won't look dated in a year.
Step 3: Purchasing a Domain
I purchased my domain through Porkbun for just $10. Here's why I chose them:
- Super affordable pricing (saved a couple bucks compared to other registrars)
- Clean, no-nonsense interface
- Free WHOIS privacy protection
- Easy DNS management
When choosing a domain:
- Keep it professional (firstname-lastname.com works great)
- Avoid numbers or hyphens if possible
- Shop around - prices can vary significantly between registrars
Step 4: Setting Up Cloudflare for DNS
Since I was already using Cloudflare for my Nextcloud setup, it made perfect sense to use it for my portfolio site too. Cloudflare offers:
- Free tier that includes everything you need
- Excellent DDoS protection
- Free SSL certificates
- Fast global DNS
- Easy DNS management interface
Here's how I connected everything:
- Add Your Domain to Cloudflare
- Sign up for a free Cloudflare account
- Add your domain
- Cloudflare will scan existing DNS records
- Update Nameservers at Porkbun
- Cloudflare will give you 2 nameservers
- Log into Porkbun
- Go to Domain Management
- Update the nameservers to Cloudflare's
- Takes about 5-30 minutes to propagate (mine was super quick!)
- Configure DNS Records in Cloudflare
- Add a CNAME record pointing to your CloudFront distribution
- Example:
yourdomain.com→d1234567890.cloudfront.net - Set it to "Proxied" for Cloudflare's benefits
- Add another for
wwwif you want
Step 5: Setting Up AWS S3 for Static Hosting
This is where the magic happens - and where you can save serious money. AWS offers a Free Tier that includes:
- 5GB of S3 storage (more than enough for a website)
- 20,000 GET requests per month
- 2,000 PUT requests per month
Here's the process:
- Create an S3 Bucket
- Name it something descriptive (doesn't have to match your domain)
- Choose a region close to your target audience
- Keep "Block all public access" checked for now (we'll use CloudFront)
- Upload Your Files
- Upload your HTML, CSS, JavaScript, and any images
- Make sure your main file is named index.html
- Organize files in folders (css/, js/, images/) for cleanliness
- Configure Bucket for CloudFront Only
- Don't enable static website hosting on S3
- Keep the bucket private
- CloudFront will access it securely
Step 6: Setting Up CloudFront
CloudFront is AWS's CDN service that will:
- Serve your site over HTTPS
- Cache your content globally for fast loading
- Provide a stable endpoint for your domain
- Create a Distribution
- Origin domain: Select your S3 bucket
- Origin access: Create new Origin Access Identity (OAI)
- Update bucket policy: Yes, let CloudFront do this
- Viewer protocol policy: Redirect HTTP to HTTPS
- Default root object: index.html
- Configure Caching
- I set mine to cache for 24 hours
- This reduces costs and improves performance
- You can invalidate the cache when you update your site
- SSL Certificate
- Since we're using Cloudflare, we can use "CloudFront Default Certificate"
- Cloudflare handles SSL for visitors
Step 7: Connecting Everything Together
The flow looks like this:
- Visitor types your domain
- Cloudflare DNS resolves to CloudFront
- CloudFront serves content from S3
- Cloudflare provides SSL and security
Security Considerations
Here are some things I did to keep my site secure:
- Never commit sensitive information to your code
- Use CloudFront's Origin Access Identity to restrict direct S3 access
- Enable AWS CloudTrail for audit logging
- Set up billing alerts (even though costs should be minimal)
- Use strong, unique passwords and enable MFA on your AWS account
- Leverage Cloudflare's security features (firewall rules, bot protection)
Costs Breakdown
Here's what I actually pay:
| Service | Cost |
|---|---|
| Domain (Porkbun) | $10/year |
| Cloudflare | $0 (free tier) |
| S3 Storage | $0.00 (free tier) |
| CloudFront | $0.00–$0.50/month |
| Total | < $1.50/month |
Lessons Learned
- Start Simple: My first version was much simpler. I added features over time.
- Cache Invalidation: Remember to invalidate CloudFront cache after updates (costs $0.005 per path)
- Image Optimization: Compress your images - they're usually the biggest files
- Test Locally: Always test your changes locally before uploading
- Version Control: Use Git, even for a simple site. GitHub offers free private repos.
- Cloudflare Page Rules: Use them to force HTTPS and handle www redirects
Conclusion
Building and hosting your own website is an incredibly rewarding experience. Not only do you end up with a professional online presence, but you also learn valuable skills in the process. The best part? With AWS's free tier and Cloudflare's free plan, you can do all of this for less than the cost of a coffee per month.
Don't wait for the "perfect" time or until you know "enough" - start building today. Your future self (and potential employers) will thank you!