This is my setup for running a personal blog: Hugo for static site generation, GitHub for version control, Vercel for deployment, Namecheap for domain, and Cloudflare for DNS/CDN. The whole process takes about an hour.
Tech Stack Overview
| Tool | Purpose |
|---|---|
| 🛠️ Hugo | Static site generator (fast, flexible) |
| 🐙 GitHub | Code hosting & version control |
| 🚀 Vercel | Deployment & hosting (free tier) |
| 🌐 Namecheap | Domain registration |
| ☁️ Cloudflare | DNS, CDN, SSL/TLS |
Prerequisites
Before starting, make sure you have:
Optional (only if you want a custom domain):
- Namecheap account (for domain)
- Cloudflare account
Install Hugo (macOS)
|
|
Verify installation:
|
|
Step 1: Create Hugo Site
Create a new site
|
|
Initialize Git
|
|
Add hugo-theme-stack theme
|
|
Configure the site
Create hugo.yaml in the root directory:
|
|
Create your first post
|
|
Edit content/posts/hello-world/index.md:
|
|
Preview locally
|
|
Open http://localhost:1313 in your browser.
Step 2: Push to GitHub
Create .gitignore
|
|
Commit and push
|
|
Create a new repository on GitHub, then:
|
|
Or use GitHub CLI:
|
|
Step 3: Deploy to Vercel
Connect GitHub to Vercel
- Go to vercel.com/new
- Click Import Git Repository
- Select your
my-blogrepository - Configure build settings:
| Setting | Value |
|---|---|
| Framework Preset | Hugo |
| Build Command | hugo --minify |
| Output Directory | public |
-
Add Environment Variable (optional):
- Scroll to Environment Variables
- Add
HUGO_BASEURL=https://yourdomain.com/ - This overrides
baseurlinhugo.yamlduring build
-
Click Deploy
The site will be available at https://my-blog-xxx.vercel.app.
💡 At this point, your blog is already live and accessible. The following steps (4-6) are optional — only needed if you want a custom domain.
Step 4: Purchase Domain on Namecheap
- Go to namecheap.com
- Search for your desired domain
- Add to cart and complete purchase
- Go to Domain List → Manage → Nameservers
- Select Custom DNS (we’ll add Cloudflare nameservers later)
Step 5: Setup Cloudflare
Add site to Cloudflare
- Go to dash.cloudflare.com
- Click Add a Site
- Enter your domain name
- Select the Free plan
- Cloudflare will scan existing DNS records
Get nameservers
Cloudflare will provide two nameservers, e.g.:
|
|
Update Namecheap nameservers
- Go back to Namecheap → Domain List → Manage
- Under Nameservers, select Custom DNS
- Add the two Cloudflare nameservers
- Save changes
Note: DNS propagation may take up to 24 hours, but usually completes within minutes.
Configure DNS records
In Cloudflare Dashboard → DNS → Records, add:
| Type | Name | Content | Proxy |
|---|---|---|---|
| CNAME | @ |
cname.vercel-dns.com |
Proxied |
| CNAME | www |
cname.vercel-dns.com |
Proxied |
Enable SSL/TLS
- Go to SSL/TLS → Overview
- Set encryption mode to Full (strict)
Step 6: Add Custom Domain to Vercel
- Go to your Vercel project dashboard
- Click Settings → Domains
- Add your domain (e.g.,
yourdomain.com) - Add
www.yourdomain.comas well - Vercel will verify the DNS configuration
Once verified, the blog is accessible at your custom domain.