Self-Hosted Home Server

Self-Hosted Home Server

Raspberry Pi 4 (2GB) Raspberry Pi OS Lite (64-bit) Docker Nginx Proxy Manager Cloudflare Tunnel Tailscale Python systemd Geekworm X703 UPS SSD

An always-on home server built from scratch on a Raspberry Pi 4, hosting this portfolio and other personal services in Docker containers, with a UPS and a custom service that protects its data during power outages.


Project Details

This server hosts the portfolio you are viewing right now, alongside other services: ntfy for phone notifications (including the messages from this site's contact form), Navidrome as a personal music server, HedgeDoc for notes and a webmail (SnappyMail) reachable only through the private Tailscale network.

Each service runs in its own Docker container, with its configuration stored on an external SSD, and all of them share an internal network. Public access goes through a Cloudflare Tunnel to Nginx Proxy Manager, which routes each subdomain to the right service without opening any ports on the router. Remote administration is done over SSH through Tailscale.

On the hardware side, a Geekworm X703 UPS hat with an 18650 battery keeps the server running when the power goes out. Since this UPS doesn't let the system read the battery level, I wrote a Python service (systemd) that detects outages indirectly: if the router stops responding for 3 minutes, it stops the containers cleanly and flushes everything to disk before the battery runs out; when power returns, it starts them again. Everything is assembled in a case with air vents that keep passive airflow going, to avoid thermal throttling under load.