Architecture, servers and key learnings Overview ▾
Sections
sunnycloud.win / personal-infrastructure

System Documentation · Build Journal

Self-Hosted
Homelab

Subhajit Debnath

A privacy-first, production-grade homelab running across nine servers - built and iterated through February to December 2026. Every architectural decision, automation script and security hardening choice documented here as a living build journal.

9 Servers
49 Services
20 TB Storage
Self-hosted Core
Linux server OS · lightweight Linux Containers · WireGuard Cloudflare Tunnel · Zero Trust UPS monitor · DoH Feb – Dec 2026
Fully live · In Production

A nine-server environment built around a single-ingress reverse proxy architecture - all external traffic enters through one node, with each server scoped to a distinct role. Cloudflare sits in front for DNS, TLS and bot protection, and the public site itself is served from Cloudflare Pages. WireGuard (three instances) provides encrypted remote access, with a mesh VPN layer for admin devices. The UPS monitor tracks the UPS and triggers a coordinated graceful shutdown on power loss.

H-01 host_1_home
ThinkCentre M710q Tiny · i7-7700T · 16 GB DDR4
Network ingress, DNS filtering and VPN gateway. All external traffic enters here via the reverse proxy. Hosts the central observability stack, the status page, push notifications and the UPS monitor primary.
Reverse proxy DNS filter WireGuard Cloudflare Tunnel Dashboards Metrics store Log store Status monitor Push notifications UPS monitor primary Mesh VPN
H-02 host_2_cloud
ThinkStation · 6C/12T · 48 GB
Primary services host. Runs most user-facing applications in containers: file sync, photos, media, SSO, password vault, notes, Git server and the learning and utility apps.
File-sync platform Photo library Media server SSO provider Password vault Notes app Git server Container console Browser IDE DocBot Feedback API
H-03 host_3_mail
ThinkCentre M900 Tiny · i7-6700T · 32 GB DDR4
Dedicated mail and document server. Full email sovereignty with a mail suite and a document system for document management.
Mail suite Document system Brevo Relay
H-04 host_4_backup
ThinkCentre M910q Tiny · i5-6400T · 16 GB DDR4
Backup aggregation node. Pulls incremental mirrors from the other servers every night. Also hosts a LAN device watcher, a failover VPN instance and a secondary DDNS updater.
Pull backups (rsync) LAN device watcher WireGuard failover UPS monitor client
H-05 host_5_power
Raspberry Pi 4 · 2 GB · Lightweight Linux
Heartbeat host with no active role. The UPS monitor primary and the secondary DNS filter both moved off this Pi in June. It now runs a telemetry agent only.
Telemetry agent
H-06 host_6_dns
NUC · i5-4250U · 8 GB
Secondary DNS filter and third VPN instance, so DNS and remote access survive a failure of the ingress node. Also drives the live fleet-status display.
DNS filter Encrypted DNS proxy WireGuard failover Telemetry agent Fleet status display
H-07 host_7_lab
Mini PC · i7-7700T · 16 GB
Lab and admin server for trying builds before they reach production. Runs its own tunnel connector, an app database and API containers, and is part of fleet monitoring.
Container console agent Tunnel connector Telemetry agent Container metrics agent
01 / Architecture
Single-ingress scales cleanly
Routing all external traffic through one reverse proxy node makes TLS management, port exposure and hardening dramatically simpler than distributing ingress across servers.
02 / Firewall
Stage the new rules before removing the old
Add the scoped firewall rules and verify them first; only then remove the blanket-trust rules. Doing it the other way round caused a live mail outage.
03 / Email
Email sovereignty is achievable
Residential deliverability is the core challenge. A reputable SMTP relay solves it without building IP reputation - the rest of the stack is surprisingly manageable.
04 / VPN
Native beats containers for critical path
WireGuard running native rather than containers proved more reliable for boot persistence - containers add a dependency layer exactly where you need reliability most.
05 / Operations
Automate operational noise early
Biweekly maintenance automation with push and email alerting eliminate the mental overhead of remembering to patch and verify - the stack becomes genuinely low-maintenance.
06 / AI
Local AI is more capable than expected
A CPU-only RAG assistant running on consumer hardware is surprisingly usable for document querying - the privacy trade-off versus cloud APIs is well worth it.
07 / Power
UPS integration is non-negotiable
UPS monitor with voltage-based thresholds (battery.charge not available on all hardware) gives a reliable 10-minute window for coordinated graceful shutdown across the full fleet.
08 / Privacy
DoH closes the last DNS gap
A DNS filter blocks ads but DNS queries remain visible to the ISP without DoH. Encrypted DNS proxy as the DNS filter upstream closes this gap with minimal complexity.
09 / Tunnel
Force SSL breaks tunneled proxies
Cloudflare Tunnel terminates SSL at the edge and forwards plain HTTP to the reverse proxy. Force SSL on any tunneled proxy host creates an infinite redirect loop - disable it and pass X-Forwarded-Proto: https instead.
10 / Git
Git-backed stacks eliminate config drift
All container console stacks sourced from a local Git server instance means the running state is always reproducible from code. No manual edits, no undocumented changes - rollback is a redeploy.
11 / DNS
DNSSEC silently drops tunnel routing
DNSSEC validation can silently discard Cloudflare Tunnel CNAME answers with no error surfaced. A per-zone forwarding rule in encrypted DNS proxy bypasses validation for affected zones cleanly.
12 / Testing
Test container firewalls from another host
Tests run on the same host bypass the container firewall chain. Run negative tests from a separate machine to see what is really exposed.
13 / Backup
Dump databases, don't copy them
Never rsync a live database directory. A compressed, encrypted dump taken from the running service is the only safe copy.
14 / Documentation
Verify automation on the host
A documented auto-update script, its cron entry and its log turned out not to exist on the server. Check the real system, not the notes.
15 / Backup
Guard backup scripts against empty sources
A sync that deletes missing files quietly emptied a backup when its source volume vanished. Point scripts at the real mount and add a minimum-size guard.

Four photographs, then the milestones that followed. This is how the homelab grew from a few machines on a windowsill into the labelled stack it is today, in the order the photos were taken. Hostnames, IP addresses and serial labels are blurred in every picture.

26 Apr 2026Day 0 of 161

Spacing on the line is proportional to the days between photos.

01 · 26 Apr 2026Day 0 · the start

Three machines, one windowsill

It starts small. A ThinkCentre small-form-factor PC runs the file-sync platform and photo library, a ThinkCentre Tiny runs the mail server, and a mini PC handles network ingress. All of it stands on a windowsill.

File-sync platformPhoto libraryMail serverNetwork ingress
02 · 17 Jun 202652 days later

Onto a shelf, with airflow

The stack moves to a shelf. Four Tinys are stacked under two large fans, and a Netgear gigabit switch with patch cables ties the machines together. The small-form-factor PC and the ingress mini PC stand alongside.

Four stacked TinysActive coolingWired switch
03 · 6 Jul 202619 days later

A permanent spot and clean power

Everything moves to the top of a wooden cabinet, with the switch now sitting on the stack. Power gets proper attention: a surge-protected strip and a UPS. How the UPS triggers a coordinated shutdown is documented in the Resilience tab.

Surge protectionUPSSwitch on the stack
04 · 4 Oct 202690 days later

Every unit gets a label

The stack as it stands in this photo: production servers at the base and in the stack, with lab, support and backup units on top. Every unit carries a label (blurred here), and the UPS sits at the right-hand end.

Production serversLab and support unitsBackup unitLabelled units

Behind the hardware

What runs on these machines, how it is protected and how it recovers is documented in the other tabs.

What changed after the photographs, in date order. Roles only; no hostnames or addresses.

  1. May
  2. 10 May

    Backup node in service

    The dedicated backup node is already carrying the nightly mirrors.

  3. 14 May

    Home automation removed

    A home-automation trial on the mail server was deployed and then fully removed. The mail server stays mail and documents only.

  4. 28 – 29 May

    Container management complete

    All four container hosts are managed through one console with Git-backed stacks. The legacy boot service is retired and a full reboot test passes.

  5. June
  6. 5 – 6 Jun

    New ingress node

    A faster mini PC replaces the original ingress node. The UPS control moves to it the same week and DNS filtering leaves the Pi.

  7. 7 Jun

    Password vault live

    A self-hosted password vault goes live, together with push notifications and a browser IDE.

  8. 10 Jun

    Lab host built

    A lab and admin server is onboarded to container management and fleet monitoring.

  9. 15 Jun

    Failover VPN instance

    The backup node gets its own VPN instance, the first of the failovers.

  10. 21 – 23 Jun

    Alerts move to push

    Backup and update scripts report through push notifications instead of email. A custom LAN device watcher replaces the network scanner container.

  11. July
  12. 18 Jul

    Third VPN instance

    A secondary DNS and VPN node adds a third instance, so DNS and remote access survive the loss of the ingress node.

  13. 19 Jul

    Mail server stuck in emergency mode

    A bad mount entry kept the mail server down for about three and a half hours. The fix: non-blocking mounts across the fleet and an external dead-man's switch.

  14. 21 – 27 Jul

    Primary host replaced

    The primary services host moves to a new workstation with 48 GB of RAM. The cold-boot test follows on 8 Aug: 30 of 30 containers back.

  15. 27 Jul

    Fleet firewall audit

    Every server gets the same host firewall baseline.

  16. August
  17. 1 – 2 Aug

    Container firewall hardening

    Static container addresses and scoped rules replace blanket trust. Removing the old rules too early caused a short mail outage, which became a lesson in the Overview tab.

  18. September – October
  19. Sep – Oct

    Remote site

    A second, geo-distributed site: a dual-WAN router rebuilt with two VLANs, a DNS node with its own VPN server and a motion-triggered webcam, a remote KVM and a Windows PC, all on the mesh VPN. External scans show only the two VPN ports answering. The remote backup build-out is paused.

  20. 26 Sep

    Private voice dictation

    Speech-to-text with local correction goes live. It uses a direct port-forward behind forward-authentication so audio never touches third-party infrastructure.

  21. 3 Oct

    Chat server retired

    The chat server is removed and its data deleted after a new kernel refused to start its database.

  22. 4 Oct

    Encrypted notes sync

    A self-hosted, end-to-end encrypted notes sync joins the ingress node.

  23. 26 – 28 Oct

    Tunnel client hardened

    After a vendor certificate advisory the tunnel client is upgraded and set to update weekly. Encrypted nightly database dumps, a local knowledge base and a meeting-minutes tool follow.

  24. 30 Oct – 5 Nov

    Remote-support KVM

    A reusable IP-KVM device is built and reachable only over the mesh VPN.

  25. November – December
  26. 11 Nov

    Fleet status on a tablet

    A wall tablet shows live fleet status from the monitoring stack.

  27. 18 Nov

    Second public domain

    Utility apps (notes, transit, fuel, weather) move to a new domain, and the public overhead-sky app goes live.

  28. 27 Nov

    Site moves to Cloudflare Pages

    The portfolio site and this page are served from Cloudflare Pages. A single project later serves all six hostnames.

  29. Nov – Dec

    Eleven learning Labs

    Free interactive learning Labs on core computer science and data topics are published on subhajitdebnath.com.

01
Single-Ingress via the reverse proxy
host_1_home · Reverse proxy · Cloudflare Tunnel · Let's Encrypt

All external traffic enters through host_1_home via the reverse proxy, which routes requests to backend services across the LAN. Only one node needs to be hardened for external exposure. Cloudflare sits in front with Bot Fight Mode, email obfuscation, proxied DNS and WAF rules recreated per zone (country allow-list, login rate limits). TLS certificates are issued via Let's Encrypt using the Cloudflare DNS challenge - no port 80 exposure required.

A Cloudflare Tunnel replaces DDNS-managed A records for all web-facing subdomains. The server initiates an outbound-only connection to Cloudflare over port 443 - home IP is never exposed in public DNS. The tunnel is locally managed: some hostnames route straight to backend services, the rest go through a wildcard to the reverse proxy, and a second connector on the lab host serves its own route. Force SSL is disabled on all tunneled reverse proxy hosts; Cloudflare terminates SSL at the edge and the tunnel carries HTTP to the reverse proxy internally. Both connectors update themselves weekly.

Three domains sit behind this entry point - the homelab zone, the personal zone and an apps zone added in November - each with its own WAF rules. Static sites and lightweight apps have since moved to a single Cloudflare Pages project, leaving only stateful services on the tunnel. Only the mail ports and the VPN endpoint use DDNS-managed records, the two deliberate exceptions.

Four browser-based SSH endpoints are exposed via Cloudflare Zero Trust - one each on the ingress, primary, mail and backup servers. Email OTP authentication, country-restricted to two regions, 6-hour session, with an SSH certificate authority deployed on all four servers. No SSH client installation required for emergency access from any device.

Key Decisions
Cloudflare Tunnel over DDNS A records - home IP never appears in public DNS, traffic routes through Cloudflare's trusted IP ranges.
DNS challenge for SSL avoids exposing port 80 on a residential connection for ACME validation.
Force SSL disabled on tunneled reverse proxy hosts - Cloudflare terminates TLS at edge; enabling it causes redirect loops.
Two DDNS exceptions only (mail and VPN endpoint) - everything web-facing is tunneled, so a DDNS change can never expose a web service.
Zero Trust browser SSH over a self-hosted remote-desktop gateway - simpler, no VM required, already integrated with the tunnel infrastructure.
Reverse proxy Cloudflare Tunnel Cloudflare Zero Trust Let's Encrypt DNS Challenge
02
Dual DNS filter with DoH Upstream
host_1_home · host_6_dns · DNS filter · encrypted DNS proxy · curated blocklists

Two DNS filter instances run across the fleet - primary on host_1_home (container), secondary on host_6_dns (native, on a dedicated secondary DNS/VPN node). The secondary originally ran on the heartbeat Pi, then briefly on the backup node, before settling on its own hardware. The router's DHCP server assigns both as DNS servers for all LAN clients, with the secondary as pure failover - not active-active.

Both instances use curated multi-source blocklists (roughly 250,000 domains, refreshed weekly on Sundays). DNS queries are forwarded upstream through an encrypted DNS proxy running on each host, wrapping all queries in HTTPS to Cloudflare's DoH endpoint - ISP cannot see resolved domains.

The DNS filter is network-wide: DHCP hands both instances to every LAN client, and VPN clients resolve through the primary as well. Corporate devices using the employer's security client tunnel their DNS through their own VPN automatically - no conflict.

Key Decisions
Encrypted DNS proxy upstream binary over apt package - the apt version is too old for custom listen address configuration.
Independent secondary DNS filter (no config-sync tool) - simpler to manage; blocklist updates are independent and failures are isolated.
Network-wide via DHCP rather than per-device configuration - every device is covered without touching it, and the secondary keeps resolution working if the primary is down.
DNS filter Encrypted DNS proxy Curated blocklists DoH Cloudflare
03
Three WireGuard instances plus a mesh VPN layer
host_1_home · host_4_backup · host_6_dns · Native · one subnet each

WireGuard runs natively as a system service on three hosts - host_1_home, host_4_backup (since June) and host_6_dns (since July) - each with its own subnet, so the loss of one entry point never takes remote access down. Peers include laptops, a Chromebook and phones, each provisioned with individual keys; retired devices are removed from every instance. VPN clients resolve through the DNS filter.

On top sits a self-hosted mesh VPN control plane on host_1_home - a second layer for admin devices and a remote-support KVM, governed by tag-based ACLs only. Private web apps and the fleet dashboard sit behind a LAN-plus-VPN access list in the reverse proxy.

Key Decisions
Native WireGuard over containers - better boot persistence and fewer moving parts in a critical path component that must survive container engine restarts. One instance per host rather than one shared gateway.
No public SSH port on any server - remote shell access is VPN-only, plus the four Zero Trust browser endpoints.
Mesh VPN as a second layer, not a replacement - tag-based ACLs keep admin devices and the KVM off the user-facing WireGuard subnets.
WireGuard Mesh VPN Tag-based ACLs Host firewall
01
Container console · Git server · Multi-host Stack Management
host_2_cloud (server) · host_1_home, host_3_mail, host_4_backup, lab host (agents)

Container console is deployed as the unified container management layer across the homelab, with Git server running co-located on host_2_cloud as the local Git backend for all stack definitions. Every container service across all six managed environments is defined as a Git-backed container stack, version-controlled in the Git server and deployed through the container console.

The container console server runs on host_2_cloud - selected for its RAM headroom (48 GB since the workstation upgrade). Standard container console agents are deployed on host_1_home, host_3_mail, host_4_backup and the lab host, each reachable by the server over the LAN on a custom port. host_5_power is excluded entirely. It carries no container runtime and the telemetry agent runs there as a native binary. All stack definition files live under a specific location on each host, with one dedicated Git server repo per host, including the lab and test environments. Container IPs are pinned statically on every container host and live-restore keeps containers running through engine restarts.

Stack secrets are managed as Container console environment variables - no .env files remain on disk. The container console and Git server both use bind mounts, covered by the existing rsync backup job on host_4_backup. The container console is accessible via the reverse proxy in a subdomain - no public exposure.

The mail suite on host_3_mail is deliberately left unmanaged. Its update script (mail-suite-update.sh) is tightly coupled to code location and runs its own container stack tool internally - managing this stack with the container console would conflict with the native updater and break the update path. The mail suite retains its own systemd startup handling; all other stacks restart cleanly via container restart policy after reboot. Updates stay with small per-service scripts rather than an auto-updater, and unused images are pruned every other day.

Key Decisions
Container console server on host_2_cloud - the most RAM of any host (48 GB) provides ample headroom.
Standard agent over edge agent - LAN-only homelab; edge agent complexity adds nothing in this topology.
One Git server repo per host - container console Git stack integration points to repo root; per-host isolation prevents cross-host deployment mistakes.
Container console env vars over .env files - centralised secret management; secrets survive stack redeployment without file presence on the host.
Startup ownership: systemd owns the container console itself; all other stacks rely on restart: unless-stopped - clean separation removes the race condition between container-startup.service and the container console on reboot.
Mail suite left unmanaged - update toolchain conflict risk too high; mail-suite-update.sh owns its own stack lifecycle.
Container console Git server Container stack definitions Git-backed Stacks Container console agent Live-restore Static container IPs Reverse Proxy Linux server OS
Container console - live environment view across the managed hosts
container console - live environment view across the managed hosts

All services are self-hosted, accessible over HTTPS via Cloudflare Tunnel or the Cloudflare Pages edge - home IP never exposed in DNS. These might not open in corporate networks as they are hosted on a different domain.

Photos
Photo library - AI-powered self-hosted photo & video library
host_2_cloud
Open
Cloud
File-sync platform - personal cloud storage & file sync
host_2_cloud
Open
Mail
Mail suite - full email sovereignty with DKIM/SPF/DMARC
host_3_mail
Open
Documents
Document system - self-hosted document management with OCR
host_3_mail
Notes app
Self-hosted note-taking and personal knowledge base - lightweight, private, local.
host_2_cloud
Open
Push notification server
Self-hosted push notification server - real-time alerts from containers, scripts and monitoring.
host_2_cloud
Open
Status monitor
Self-hosted uptime monitor with public status page - tracks all homelab services.
host_1_home
Labs
Eleven interactive learning labs - data, systems, security, compilers, ML, SQL and protocols. Runs in the browser.
Cloudflare Pages
Open
Astro
Astrology companion app - self-hosted and served over HTTPS via Cloudflare Tunnel.
host_3_mail
Open
Notes sync
Encrypted notes sync across devices - end-to-end encrypted, self-hosted database.
host_1_home
Sky app
Public overhead tracker for flights and satellites around a chosen location.
Cloudflare tunnel
Nearby departures
Phone-location app showing nearby public transport stops and live departures.
Cloudflare Pages
Fuel price
Cheapest nearby fuel from the phone location.
Cloudflare Pages
Weather
Current conditions and 10-day forecast with saved cities and phone location.
Cloudflare Pages
Vehicle expense log
Invite-only log for vehicle costs.
Self-hosted
Dictation
Local AI voice-to-text dictation - audio stays off third-party infrastructure.
Self-hosted

LAN and WireGuard VPN access only - not publicly exposed. Click any card for details.

DocBot
Local RAG AI assistant - query personal documents without cloud APIs.
LAN & VPN only
Fleet Dashboard
Live server metrics across all nodes - CPU, RAM, containers and uptime.
LAN & VPN only
Monitoring
Dashboards across all nodes - metrics, logs and alert rules.
LAN & VPN only
Media
Private media server for films, TV & music - streamed on the home network or over the VPN.
LAN & VPN only
New-device watcher
Custom ARP watcher - flags new and unknown devices joining the network with a push alert.
LAN & VPN only
FileUpload
Browser based file upload portal for connected devices on Home network - no app required.
LAN & VPN only
Services
PIN-gated service index - quick navigation to all homelab services over LAN and VPN.
LAN & VPN only
German Learning
German language learning app - private daily practice on the home network.
LAN & VPN only
Skywatcher
Real-time tracker for flights overhead and visible satellites and planets.
LAN & VPN only
Meeting Minutes
Local AI meeting minutes - audio in, structured notes out.
LAN & VPN only
Local Translate
Local AI translation - text translated on-device with no cloud API.
LAN & VPN only
YT Summarizer
AI-powered YouTube summariser - paste a link, get a structured summary.
LAN & VPN only
Homelab Wiki
Local AI knowledge wiki - ask questions across homelab documentation.
LAN & VPN only
File browser
View-only file browser.
LAN & VPN only
Voice translator
Local speech-to-speech translation - no cloud API.
LAN & VPN only
Photo slideshow
Slideshow of the photo library for a display.
LAN & VPN only
Stack Overview
Windows desktop app showing every container stack at a glance.
LAN & VPN only
Fuel watch
Private fuel-price watcher behind single sign-on.
LAN & VPN only
01
Self-Hosted Cloud, Photos & Media
host_2_cloud · File-sync platform · Photo library · Media server · DocBot · LVM

File-sync platform is the primary cloud storage platform - a full self-hosted alternative to Google Drive, running in containers with an 8 TB external data volume managed via LVM. The LVM layout was designed from the start to allow incremental expansion without service interruption.

Photo library runs alongside the file-sync platform for photo management, deliberately separated to leverage its machine-learning photo features and superior mobile experience. External libraries mount the file-sync platform's photo folders as read-only - single source of truth, with the photo library's AI features on top.

Media server runs in host network mode for smooth local media streaming, accessible on the home network or remotely via WireGuard. DocBot is a private RAG pipeline - a local LLM runtime, a local language model, a Python API framework and a vector database - for querying personal documents without sending data to external APIs.

Key Decisions
LVM designed for incremental expansion - storage grows without rebuilding containers or reconfiguring services.
Photo library separated from the file-sync platform for performance and AI features; external libraries keep the file-sync platform as the single source of truth.
DocBot intentionally runs on CPU inference - fully local with no GPU dependency or cloud API calls.
File-sync platform Photo library Media server Local LLM runtime Vector database Python API framework Container stack definitions LVM
02
Self-Hosted Mail & Document Stack
host_3_mail · Mail suite · Document system

Mail suite manages the complete email stack - DKIM, SPF and DMARC all verified and active. Outbound mail routes through a Brevo SMTP relay to solve residential IP deliverability without months of reputation building. A dedicated 500 GB LVM volume is allocated for mail data with growth headroom reserved.

Document system runs on the same server for document management with OCR - all household documents, receipts and correspondence are ingested, tagged and made searchable. Public access via Cloudflare Tunnel at a dedicated subdomain.

Key Decisions
Brevo SMTP relay for deliverability - avoids the months-long process of building residential IP reputation from scratch.
Mail suite's built-in netfilter handles mail port protection - adding intrusion-ban daemon on top would conflict with its own port management.
Document system publicly accessible via tunnel - document access from anywhere without VPN dependency.
Mail suite Brevo Relay DKIM · SPF · DMARC Document system LVM Containers
03
Self-Hosted Feedback Widget
host_2_cloud · Python API framework · SQLite · Container · Cloudflare Tunnel

A fully self-hosted feedback widget deployed across the personal sites. Visitors can leave a thumbs up/down rating and a comment - all data stays on-premises with zero third-party exposure. Formspree was evaluated and rejected to avoid handing visitor data to an external service.

The API runs as a container on host_2_cloud, exposed via Cloudflare Tunnel through the reverse proxy. Submissions are stored in SQLite and trigger an email via the self-hosted mail suite stack. Three gates guard the endpoint - a WAF referer rule, a CORS allow-list for the site domains and a per-IP rate limit (5 submissions per hour) keyed on the real client IP. The mail password is injected at container startup via an entrypoint script reading from an .env file - never baked into the image.

Key Decisions
Self-hosted over Formspree - visitor feedback is data; keeping it on-premise was a deliberate privacy choice.
SQLite over a full database - feedback volume is low; single-container simplicity wins.
Password via .env and entrypoint script - secrets stay out of the image layer, survive rebuilds without re-entering credentials.
Python API framework SQLite Containers SMTP client CORS CSP
01
Server Hardening Baseline
All servers · SSH · Intrusion-ban daemon · Host firewall · Packet filter

SSH runs on a non-standard port across all servers with key-based authentication only - keys provisioned from known devices (laptop, Chromebook, phone). Root login is disabled on all main servers. Intrusion-ban daemon is configured with a 3-retry threshold and an aggressive ban duration, with LAN subnet whitelisted to prevent self-lockout. The recidive jail escalates repeat offenders.

A fleet-wide firewall audit in July put a host firewall on every server, restricting traffic to expected ports only - SSH, HTTP/HTTPS and service-specific ports scoped to LAN or reverse proxy IP only, with a purpose comment on each rule. Container-level route rules are hardened on all container hosts, so a published port still needs an explicit allow. host_5_power uses packet filter with a drop-all policy and only the ports it needs. IPv6 is disabled across all servers - no global IPv6 address is assigned.

Private apps and the fleet dashboard sit behind a LAN-plus-VPN access list in the reverse proxy; the metrics store only accepts scrapes from fleet nodes. Public hosts add three layers: WAF rules at Cloudflare, per-IP rate limits and, for the apps with accounts, SSO with forward-auth. After a Cloudflare certificate advisory in October, both tunnel connectors were upgraded and moved to weekly automatic updates.

Container services on host_2_cloud are bound to 127.0.0.1 for internal-only services - DocBot backend and local LLM runtime were unintentionally exposed on 0.0.0.0 and corrected during hardening review.

Key Decisions
Aggressive intrusion-ban daemon ban duration - residential IPs rarely change legitimately, so an aggressive ban meaningfully reduces brute-force surface.
Mail suite's built-in netfilter handles mail port protection exclusively - host intrusion-ban daemon not installed on host_3_mail to avoid conflicts.
host_5_power uses packet filter drop-all - SSH is LAN-only and intrusion-ban daemon is unnecessary with this posture.
WAF challenges can silently break background requests from mobile and sync clients - every new public host is checked against the rate-limit rules before it goes live, and the feedback API runs three explicit gates (referer rule, CORS allow-list, per-IP limit).
Intrusion-ban daemon Host firewall Packet filter SSH Key Auth Non-standard Port
02
VAPT - April 2026
7 domains · Port scanner · TLS scanner · Web scanner · header audit

A structured vulnerability and penetration test was run across all 7 public-facing domains using port scanner, TLS scanner, web scanner and a full HTTP security header audit. SSL/TLS was scanned against the origin directly (bypassing Cloudflare) via LAN IP. All findings were triaged, fixed or formally accepted with rationale.

Findings & Outcomes
HSTS missing - fixed via Cloudflare dashboard and reverse proxy config. Max-age 12 months, includeSubDomains, preload.
Missing security headers on static sites - X-Frame-Options, CSP, Referrer-Policy, Permissions-Policy added to reverse proxy advanced config.
Port 80 returning HTTP 200 on mail subdomain - accepted as-is; mail suite default, modifying risks mail delivery.
Missing headers on photos subdomain - accepted; photo library sets its own internal headers and overrides proxy-level headers.
Port scanner TLS scanner Web scanner HSTS CSP TLS 1.2 / 1.3
Header Static Sites Cloud / Photos Mail
Strict-Transport-Security✓ 12mo✓ 6mo
X-Frame-Options✓✓✓
X-Content-Type-Options✓✓✓
Content-Security-Policy✓acceptedaccepted
Referrer-Policy✓accepted✓
Permissions-Policy✓acceptedaccepted

Next VAPT: not yet scheduled

01
UPS Fleet Protection
host_1_home · UPS monitor primary · Green Cell AIO 600VA

A Green Cell AIO 600VA UPS is connected via USB to host_1_home, which acts as the UPS monitor primary server. The primary, mail and backup servers are UPS monitor secondaries, polling the primary every 5 seconds. On power loss, staged voltage alerts go out first; if mains is not restored within a 10-minute countdown, the services, mail and backup servers shut down gracefully in parallel via SSH, and host_1_home powers off last, 30 seconds later. The secondary DNS/VPN node is deliberately excluded so DNS stays available as long as possible.

The UPS does not report battery.charge - only battery.voltage. A voltage-based low threshold is set via override in the UPS monitor driver config. USB cable disconnection has a 1-hour grace period to avoid false shutdowns from accidental cable disconnects. Total time from outage to all servers off is approximately 12 minutes. Two live tests fired a real shutdown end to end. Boot recovery after power returns depends on the BIOS AC power-recovery setting.

This system replaced the previous ping-based Power Sentinel watchdog, which was a dead man's switch dependent on continuous network reachability. UPS monitor is purpose-built for UPS integration and provides more reliable shutdown semantics. The heartbeat Pi, host_5_power, now carries no active role in the shutdown chain; an external dead-man's-switch check (host cron plus an HTTP probe, about 10 minutes of grace) alerts if the fleet goes silent.

Key Decisions
10-minute countdown before shutdown - provides sufficient window for brief outages and power flickers without triggering a false shutdown.
Voltage-based threshold over charge percentage - this UPS model does not expose battery.charge; voltage is the reliable signal.
USB cable disconnect grace period (1 hour) - prevents false shutdowns from accidental disconnects; fail-safe is disabled by design.
UPS monitor replaced ping-based Power Sentinel - purpose-built for UPS integration, more reliable shutdown semantics, no dependency on network reachability.
UPS monitor UPS driver Green Cell AIO 600VA SSH Shutdown Systemd
02
Automatic Stack Recovery on Boot
All servers · systemd · container-startup · live-restore

After a graceful shutdown or container package upgrade, containers were not restarting automatically despite restart: always policies. Two root causes: Container package upgrades via the weekly maintenance script restarted the daemon and wiped container state; and container's policy was not restoring state reliably on boot across all machines.

Three fixes were applied fleet-wide. A systemd oneshot service fires on every boot, waiting for the container engine to fully initialise before bringing up all stacks in order. The os-update.sh maintenance script was updated to restart all stacks after any container package upgrade. Live restore is enabled on every container host so containers survive daemon restarts without stopping.

host_2_cloud has an additional boot dependency - the container engine itself is held until all five LVM data mounts are confirmed ready, preventing container startup races against slow disk initialisation.

Key Decisions
systemd oneshot over restart: always alone - oneshot gives explicit ordering control and logs to a dedicated file; restart policy is a fallback, not the primary mechanism.
10-second pre-start delay - gives container engine time to fully initialise before stacks are started.
Non-critical mounts marked nofail fleet-wide - a missing secondary disk never blocks boot into a rescue shell.
Mount gating on host_2_cloud - container engine held until all five LVM volumes are ready, preventing file-sync platform and photo library from starting before their data volumes mount.
Systemd Oneshot Container live-restore LVM Mount Gating Container stack definitions
03
Biweekly Automated Maintenance Cycle
All servers · cron · SMTP client · ordered shutdown

Each server runs an independent biweekly maintenance script on a fixed Sunday schedule. The cycle has four phases: a 24-hour advance notice email on Saturday, a maintenance-start announcement on Sunday, an ordered container stack shutdown followed by reboot and a post-reboot health report emailed to the ops log recipients.

A biweekly gate function inside each script anchors to a fixed start date - cron fires every weekend, but the script exits silently if it is not a maintenance week. All scripts send email via SMTP client routing through the self-hosted mail suite stack. The post-reboot report includes a live container list output so any failed containers are immediately visible.

Key Decisions
Weekly OS updates on all main hosts, biweekly full maintenance cycle - patches land within a week, reboots stay predictable.
Biweekly cadence - short enough to stay current with security patches, long enough to avoid operational noise.
Ordered container shutdown before reboot - prevents unclean container state and data corruption on storage-heavy services.
SMTP client on all servers via self-hosted mail stack - every automated script sends real, deliverable email reports with no external dependency.
Bash Automation Cron SMTP client Ordered Shutdown Email Alerting
01
Dashboards · Metrics store · Log store · Telemetry agent
All servers · host_1_home central · Telemetry agents

A full self-hosted observability stack is deployed across every server in the fleet. Metrics store handles metrics collection, Log store aggregates logs with 30-day retention and Dashboards provide unified views and alerting - all running centrally on host_1_home. Telemetry agent is the unified agent on every node, shipping both metrics and logs to the central stack over the LAN.

Remote telemetry agents run as containers on host_2_cloud, host_3_mail, host_4_backup and the lab host. On host_5_power (lightweight Linux, no container runtime) the telemetry agent runs as a native ARM64 binary with a systemd service, and the secondary DNS/VPN node runs it natively with journal logs; the sandbox box is scraped pull-based. DNS query logs are deliberately not shipped. A standalone Container metrics agent container runs on all container servers for per-container metrics - required because the telemetry agent's embedded container metrics does not support cgroup v2 with the systemd driver on the Linux server OS.

A lightweight Container-status API service runs on each container server, exposing a live container list feed as JSON. This powers the Fleet Dashboard - a LAN-only overview at a dedicated subdomain showing live CPU, RAM, temperature, uptime and container count per server. Clicking any server card opens a drill-down modal with per-container CPU, RAM, port mappings and uptime. Auto-refreshes every 30 seconds, accessible via WireGuard from anywhere; a compact fleet-status page also runs on a wall tablet. The dashboard's vhost is restricted to LAN and VPN.

Dashboards are accessible on the LAN only - no public Cloudflare record - so observability data stays fully off the public internet. SMTP alerting routes through the self-hosted mail suite stack.

Key Decisions
Central stack on host_1_home - already the ingress node; co-locating observability minimises inter-server hops for scraping.
Telemetry agent over individual host metrics exporter + log shipper - one agent per node handles both metrics and logs, reducing configuration surface.
Standalone container metrics agent over the telemetry agent's embedded container metrics - the embedded version does not support cgroup v2 + systemd driver, which is the Linux server OS default.
Native binary on host_5_power - lightweight Linux has no container runtime; ARM64 telemetry agent binary with systemd is the clean fit, no runtime dependency added.
Fleet Dashboard LAN-only, no public Cloudflare record - observability data (IPs, container names, port mappings) stays fully off the public internet.
Dashboards LAN-only, no public Cloudflare record - same reasoning as above.
Log store 30-day retention - balances audit usefulness against disk and auto-purges logs containing IPs and ban events.
Dashboards Metrics store Log store Telemetry agent Container metrics agent Container-status API Fleet Dashboard Host metrics exporter SMTP Alerting

02
Status monitor
host_1_home · Service Uptime Monitoring

The status monitor runs about 30 service checks plus a ping check per host, every 60 seconds, with a publicly accessible status page. A biweekly maintenance window silences alerts during the planned update cycle. Monitors are organised into colour-coded tag groups - External, Infrastructure, Network, Monitoring, Misc and Websites. Alerts route via two channels: Push notifications to the Android app over WebSocket and email via the self-hosted mail suite stack. The full monitor list was bulk-provisioned via the Status-monitor API Python library. The dashboard is LAN and VPN only; the status page is intentionally public and read-only - no credentials exposed.

Key Decisions
Public status page intentionally open - useful for household awareness during incidents, no sensitive data exposed.
Dual notification channels - push notification server for instant push, email for a durable audit trail.
Bulk monitor provisioning via API - no manual UI clicks, monitor list is reproducible from script.
Status monitor Containers Push notification server SMTP Reverse proxy Status-monitor API

03
New-device watcher
host_4_backup · Custom ARP Watcher

A small custom script scans the LAN via ARP every five minutes and compares what it finds with a list of named, known devices. Any unrecognised device joining the network triggers a push alert. It replaced a heavier off-the-shelf network scanner in June and is hosted deliberately on the dedicated backup node rather than a primary service host, so security monitoring stays independent and remains up even during restarts of the main stack.

Key Decisions
Hosted on host_4_backup - keeps network monitoring independent from primary services; a compromised or restarting primary host does not take down the watchdog.
Plain script over a full scanner product - no web UI, no database and no inbound attack surface; the alert is the product.
Bash ARP Scanning Push alerts

04
Fleet Dashboard
host_1_home · Live Infrastructure Overview

A custom-built single-page dashboard showing real-time server health across all nodes. Each server card displays live CPU, RAM, system load, temperature, uptime and a running/total container count badge. Clicking any card opens a drill-down modal with per-container name, status, uptime, CPU, RAM and port mappings. Data sources are Metrics store for node metrics and a lightweight Container-status API service on each host exposing a live container list feed as JSON. Auto-refreshes every 30 seconds and accessible via WireGuard from anywhere.

Key Decisions
Custom-built over an off-the-shelf dashboard - full control over layout, data sources and refresh behaviour without an additional service dependency.
Container-status API sidecar on each host - exposes live container state as JSON and powers the per-container drill-down without requiring container console or direct container socket exposure over the network.
LAN-only, no public Cloudflare record - fleet data (IPs, container names, port mappings) stays fully off the public internet.
Web server (minimal image) Metrics store Container metrics agent Container-status API Vanilla JS Containers

Five alert rules are active, all routed to email via the self-hosted mail suite stack.

High RAM Usage
Fires when node memory utilisation exceeds 60% for more than 5 minutes. Evaluated across every node via the nodename label.
Source: Metrics store · Pending: 5m · Keep firing: 5m
High CPU Usage
Fires when average CPU utilisation exceeds 60% for more than 5 minutes. Evaluated across every node via the nodename label.
Source: Metrics store · Pending: 5m · Keep firing: 5m
High CPU Temperature
Fires when average CPU temperature exceeds 60°C for more than 5 minutes. Uses hwmon chip data, excluding ACPI thermal zones.
Source: Metrics store · Pending: 5m · Keep firing: 5m
Container Down
Fires when any named container disappears from recent metrics store scrapes - indicating an unexpected stop or crash.
Source: Metrics store · Pending: 2m · No-data: Normal
Intrusion-ban daemon Ban Detected
Fires when a ban event appears in the log store log stream. Useful for monitoring active brute-force attempts across all servers.
Source: Log store · Pending: none · Keep firing: 5m
Loading live status…
01
Incremental rsync Mirror to a Dedicated Node
host_4_backup · rsync over SSH · WD Red 2 TB NAS SSD

host_4_backup is a dedicated ThinkCentre M910q running as the sole backup destination for the fleet. A 1 TB ext4 partition on a WD Red NAS SSD is mounted at a fixed path and serves as the single landing zone for all inbound backup jobs. A further ~800 GB remains unallocated on the drive, reserved for future growth without repartitioning.

All backups use rsync over SSH in a pull model - host_4_backup initiates each transfer on schedule, reading from the source server and writing to a dedicated subdirectory. Sources hold no credentials to the backup node, so a compromised source cannot reach the backup copy. Delta-only transfers keep transfer windows short even for large data volumes; named container volumes are covered on every host.

All jobs run hot against host filesystem paths - no containers are stopped or paused during backup. For the mail stack specifically, rsync reads directly from container volume paths on the host filesystem, bypassing the mail daemon entirely and avoiding the UID remapping issues that container-level stops can trigger.

Key Decisions
rsync mirror over snapshots - single live copy with delta transfers; no versioning overhead for a homelab context.
Pull model - the backup node owns the schedule and holds read access to the sources; sources have no write path to the backup copy, which limits the blast radius of a compromised host.
Hot backup against host filesystem paths - avoids container restarts, eliminates UID remapping risk on the mail stack.
Dedicated node over co-hosting - isolates backup I/O from production workloads and keeps failure domains separate.
1 TB active partition with ~800 GB unallocated - expansion without repartitioning or service interruption.
rsync SSH ext4 LVM Cron Bash

Independent backup jobs, each scoped to one source and running on its own cron schedule. All land on host_4_backup.

Source What Cadence
host_3_mail Mail stack - vmail, database, webmail data, config Every 4 hours
host_3_mail Document management - media, data, database, inbox Daily 01:45
host_2_cloud Container volumes + service configs Daily 03:00
host_2_cloud Personal cloud storage - selected folders only Daily 03:00
host_2_cloud SSO provider database - encrypted dump, 7-day retention Daily 02:40
host_3_mail Full mail backup - 3-week rolling copy, kept locally Weekly, Sunday 02:00
host_1_home Service configs + Monitoring stack volume Daily 02:00

Several data categories are deliberately excluded from backup. All are either fully rebuildable or carry insufficient value to justify the transfer and storage cost.

Data Source Reason
AI model weights (LLM) host_2_cloud Fully rebuildable via model pull - 4.4 GB, not worth transfer cost
AI photo model cache host_2_cloud Auto-regenerated on service start - ~800 MB
Screenshots host_2_cloud Transient / low value - excluded by design
WhatsApp media exports host_2_cloud Large volume, already retained on device - excluded to save space
Mail spam/AV databases host_3_mail Auto-regenerated by spam filter and antivirus on startup
Mail cache (Redis) host_3_mail In-memory cache - rebuildable, no persistent value

One dedicated backup script per source server, running as root via cron. All scripts share a common pattern: Berlin timezone logging, clean trap handling on interruption and a push notification on success or failure. A minimum-size guard on the mail copy skips the run if the source looks empty.

Script Runs on Covers
mail-suite-backup host_3_mail Mail stack volumes + config
docs-backup host_3_mail Document management volumes
cloud-backup host_2_cloud Container volumes, service configs, cloud storage folders
home-backup host_1_home Service configs, observability stack volume
Common Script Pattern
Timezone-aware logging - all timestamps use Europe/Berlin, generated fresh per log entry.
Trap on INT/TERM - logs the interruption cleanly and exits without leaving partial transfers.
Runs as root via cron - no sudo calls inside scripts; avoids credential prompts in unattended context.
Push notification on success and failure - delivered through the self-hosted push server, so alerts do not depend on the mail stack being up.