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.
System Documentation · Build Journal
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.
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.
X-Forwarded-Proto: https instead.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.
Spacing on the line is proportional to the days between photos.
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.
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.
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.
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.
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.
The dedicated backup node is already carrying the nightly mirrors.
A home-automation trial on the mail server was deployed and then fully removed. The mail server stays mail and documents only.
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.
A faster mini PC replaces the original ingress node. The UPS control moves to it the same week and DNS filtering leaves the Pi.
A self-hosted password vault goes live, together with push notifications and a browser IDE.
A lab and admin server is onboarded to container management and fleet monitoring.
The backup node gets its own VPN instance, the first of the failovers.
Backup and update scripts report through push notifications instead of email. A custom LAN device watcher replaces the network scanner container.
A secondary DNS and VPN node adds a third instance, so DNS and remote access survive the loss of the ingress node.
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.
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.
Every server gets the same host firewall baseline.
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.
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.
Speech-to-text with local correction goes live. It uses a direct port-forward behind forward-authentication so audio never touches third-party infrastructure.
The chat server is removed and its data deleted after a new kernel refused to start its database.
A self-hosted, end-to-end encrypted notes sync joins the ingress node.
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.
A reusable IP-KVM device is built and reachable only over the mesh VPN.
A wall tablet shows live fleet status from the monitoring stack.
Utility apps (notes, transit, fuel, weather) move to a new domain, and the public overhead-sky app goes live.
The portfolio site and this page are served from Cloudflare Pages. A single project later serves all six hostnames.
Free interactive learning Labs on core computer science and data topics are published on subhajitdebnath.com.
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.
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.
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.
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.
restart: unless-stopped -
clean separation removes the race condition between container-startup.service and the container console on reboot.
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.
LAN and WireGuard VPN access only - not publicly exposed. Click any card for details.
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.
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.
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.
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.
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.
| Header | Static Sites | Cloud / Photos | |
|---|---|---|---|
| Strict-Transport-Security | ✓ 12mo | ✓ | 6mo |
| X-Frame-Options | ✓ | ✓ | ✓ |
| X-Content-Type-Options | ✓ | ✓ | ✓ |
| Content-Security-Policy | ✓ | accepted | accepted |
| Referrer-Policy | ✓ | accepted | ✓ |
| Permissions-Policy | ✓ | accepted | accepted |
Next VAPT: not yet scheduled
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.
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.
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.
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.
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.
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.
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.
Five alert rules are active, all routed to email via the self-hosted mail suite stack.
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.
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 |
Want to know more?
Thanks for your time!
Something went wrong. Please try again.