Building a Self-Hosted Blog with Astro
Building a Self-Hosted Blog with Astro
One of my first projects was setting up this very blog you’re reading. Let me share the technical decisions behind it and why I chose this particular stack.
The Tech Stack
After researching various options, I settled on:
- Astro: A modern static site generator perfect for content-focused websites
- Coolify: Self-hosted PaaS for deployment
- Umami: Privacy-focused, self-hosted analytics
- Markdown: For all content, stored in Git
Why Astro?
Astro stood out for several reasons:
- Performance: Ships zero JavaScript by default
- Flexibility: Write content in Markdown, but can use any UI framework when needed
- Developer Experience: Fast builds, hot reload, TypeScript support
- SEO-Friendly: Server-rendered by default
Self-Hosting Advantages
While platforms like Medium or WordPress.com are convenient, self-hosting gives me:
- Complete control over my content and data
- No platform lock-in - I own everything
- Learning opportunity to understand the full stack
- Cost efficiency for a personal blog
- Privacy for my readers
Analytics with Umami
Instead of Google Analytics, I chose Umami because:
- It’s open-source and self-hosted
- Privacy-focused (no cookies, GDPR compliant)
- Lightweight and fast
- Simple, clean interface
- Provides the metrics I need without overwhelming data
The Migration Plan
Starting with self-hosting is great, but I’ve also planned for growth. If traffic increases significantly, my migration path includes:
- Phase 1 (Current): Self-hosted on Proxmox LXC
- Phase 2 (10k+ monthly visitors): Move to a VPS with better resources
- Phase 3 (50k+ monthly visitors): Consider CDN integration
- Phase 4 (100k+ monthly visitors): Evaluate managed hosting or edge computing
The beauty of using Astro and standard tools is that migration is straightforward - it’s just static files and a build process.
Continuous Deployment
I’ve set up GitHub Actions to automatically deploy when I push to the main branch. This means I can write in Markdown, commit, and the site updates automatically.
Conclusion
This setup gives me the perfect balance of control, performance, and simplicity. It’s ideal for a personal blog that may grow over time, with a clear path forward for scaling.
If you’re interested in the technical details or want to set up something similar, feel free to reach out!