Website Migration
From GitHub Pages to self-hosted TrueNAS infrastructure
Overview
In January 2026, I migrated nbnstack.com from GitHub Pages to self-hosted infrastructure running on my TrueNAS server. The migration was motivated by a desire for complete control over the hosting environment, elimination of external dependencies, and integration with my existing homelab monitoring systems.
The website now runs in a lightweight nginx Docker container with Cloudflare Tunnel providing secure public access without exposing ports on my home network. Automated deployment scripts handle updates, and the entire site is backed up alongside other TrueNAS data.
Why Self-Host?
- Complete Control: Full control over server configuration, headers, caching, and deployment process
- No External Dependencies: Eliminates reliance on GitHub's infrastructure and policies
- Learning Opportunity: Hands-on experience with nginx, Docker networking, and web server administration
- Integration with Homelab: Website health monitoring via Home Assistant and Uptime Kuma
- Zero Cost: Runs on existing TrueNAS hardware with no additional hosting fees
- Faster Iteration: Direct file access means instant updates without git push delays
Technical Architecture
Web Server
nginx:alpine (Docker container)
Reverse Proxy
Cloudflare Tunnel (cloudflared)
DNS
Cloudflare DNS with proxy enabled
Storage
ZFS dataset on TrueNAS mirror pool
Deployment
Automated bash scripts with Docker Compose
Monitoring
Home Assistant + Uptime Kuma
Migration Process
Phase 1: Infrastructure Setup
- Docker Compose Stack: Created nbnstack-web container with nginx:alpine image
- File Structure: Migrated GitHub Pages content to /mnt/SourPatchNAS/nbnstack.com/*
- nginx Configuration: Tuned for performance with gzip, browser caching, security headers
- Cloudflare Tunnel: Configured secure tunnel from TrueNAS to Cloudflare without port forwarding
Phase 2: DNS and SSL
- DNS Migration: Updated nbnstack.com A records to point to Cloudflare proxy
- SSL/TLS: Cloudflare handles SSL certificates automatically with Universal SSL
- WWW Redirect: Configured automatic redirect from nbnstack.com to www.nbnstack.com
- CNAME Records: Updated all subdomains to point to new infrastructure
Phase 3: Automation and Monitoring
- Deployment Script: Created deploy-nbnstack.sh for automated updates and container restarts
- Health Monitoring: Uptime Kuma checks every 60 seconds with Home Assistant integration
- Performance Monitoring: nginx access logs analyzed for traffic patterns and optimization
Benefits Realized
- Instant Updates: Direct file editing means changes go live immediately without git workflows
- Complete Visibility: Full access to nginx logs, traffic patterns, and error monitoring
- Custom Configuration: Implemented optimal caching rules, compression settings, and security headers
- No Rate Limits: Unlimited bandwidth and request rates
- Integrated Monitoring: Website uptime tracked in Home Assistant alongside other homelab services
- Learning Experience: Gained practical experience with nginx, Docker networking, and Cloudflare infrastructure