Hosting a Site on a Raspberry Pi
A personal static site runs on a Raspberry Pi because one unmaintained i18n library broke Vercel compatibility—a pragmatic reason that cascades into a full self-hosting stack walkthrough.
What Matters
- Caddy handles TLS and reverse proxy; config maps port 4321 (Astro), 5173 (SvelteKit), or 3000 (React) to the domain.
- Router port-forwarding plus a DNS A-record pointing to the router’s public IP is the full network setup.
- pm2 runs the built Node.js entry point (entry.mjs or entry.cjs) persistently without a process supervisor daemon.
- GitHub Actions via appleboy/ssh-action SSHs into the Pi on push, triggering a pull-all.sh script that rebuilds all projects.
- The shell script assigns ports from a hardcoded array (4321, 4322) to avoid colliding with Linux system ports.
- npm run build – –port outputs to dist; pm2 restart all redeploys without per-project configuration changes.