Impact-Site-Verification: 578d421e-1081-463d-918b-ec5e29c5b9db
<Back

Container-Based Multi-Function Home Server

Personal Project

Overview

Built a home server as Infrastructure-as-Code on a Raspberry Pi 5 (8GB RAM) with a 2TB NVMe SSD running Ubuntu Server 24.04 LTS arm64: 10 services defined in Docker Compose, plus shell scripts. Consolidates a smart-home hub, Time Machine backups, web change detection, uptime monitoring, and remote access over Tailscale into a single box, with configuration kept in Git so the environment can be rebuilt.

Architecture

Uses Docker Compose profiles (`phase1`–`phase4` and `full`) to bring the stack up in dependency order. During validation only the relevant phase is started; in normal operation `full` starts every service. Each phase has a matching setup script, so each phase can be re-run.

Bridge and Host networks are used deliberately for different roles. Containers with layer-2 requirements (Samba, Homebridge, Home Assistant — SMB, mDNS, Bluetooth) run on the host network; plain HTTP services are isolated on a bridge. The Homepage dashboard's `siteMonitor` resolves bridge services by container name and host services by the Docker bridge gateway IP, giving a single monitoring surface across both worlds.

The procedure for managing Nginx Proxy Manager proxy hosts through its REST API (Bearer token) is documented in the repository. Avahi publishes CNAMEs (`/etc/avahi/cname.d/services.conf`) that map `<service>.local -> ubuntu-pi.local` on the fly, giving every service a `.local` hostname without polluting the household DNS.

  1. phase1 platform: Nginx Proxy Manager / Docker Socket Proxy (read-only socket exposure for Homepage) / Homepage / MkDocs Material
  2. phase2 files: Samba (Time Machine, `vfs_fruit` enabled)
  3. phase3 smart home: Homebridge (HomeKit) / Home Assistant (`privileged` + host network + D-Bus)
  4. phase4 monitoring: Playwright Chrome (JS rendering) / Changedetection.io / Uptime Kuma
  5. Installed directly on the host: Tailscale (exit node and subnet route) / Rclone (daily cron backup)

Operations & Observability

The scripts from `phase0-prereq.sh` through `phase4-utility.sh` check the existing state before installing packages or writing config files, so re-runs do not duplicate work.

`verify-all.sh` runs 12 checks (Docker; the HTTP response or container state of 8 services; Samba; Tailscale; Rclone) and exits with code 1 if any fails.

A daily Rclone cron job backs up to Google Drive (bandwidth capped with `--bwlimit 5M`). Persistent data lives in the git-ignored `~/data/`, separate from configuration in `configs/`.

Hardware and OS Setup

OS installation is scripted as step1 to step7: a SHA256-verified Ubuntu image is written to NVMe, cloud-init applies the initial settings, and the EEPROM boot order puts NVMe first.

Technologies

Raspberry Pi 5Ubuntu Server 24.04DockerDocker ComposeNginx Proxy ManagerSamba (vfs_fruit)HomebridgeHome AssistantTailscaleRcloneAvahi (mDNS)MkDocs MaterialChangedetection.ioPlaywrightUptime KumaBashIaC