Skip to content

Operations

What to do after the building is done: bring everything back after a restart, update without surprises, and the short list of checks that keeps the setup honest. Print the first section, or keep it on your phone: it is the one you need when the house has no DNS.

Why. R5: FileVault is on and nobody is logged in automatically, so after any restart of the Mac the three VMs are down until you log in and unlock their disks. Until then the house has no ad filtering (clients fall back to the gateway’s DNS, by design of step 6.11), no Home Assistant, no camera recording to HomeKit, and the remote site has no failover.

Mac

  1. Log in. The login agent runs vm-up and starts the three VMs.
  2. Open Terminal:
Terminal window
vm-unlock all # one Touch ID, then each disk is unlocked in turn
  1. Wait two minutes, then check:
Terminal window
for h in infra home standby; do ssh -o ConnectTimeout=5 $h 'printf "%-8s up %s, %s containers\n" "$(hostname)" "$(uptime -p | cut -c4-)" "$(docker ps -q | wc -l)"'; done
dig +short +time=2 @10.0.2.5 debian.org | head -1 # an address: DNS is back
curl -s -o /dev/null -w "Home Assistant %{http_code}\n" http://10.0.5.2:8123/manifest.json # 200
ssh standby 'sudo ws-ctl status | head -5' # standby, primary seen

Verify. Three lines with container counts, an address, 200, and the standby in role standby. In the Home app, the cameras stream within five minutes.

If a VM does not answer. utmctl status infra shows whether it runs. started and no SSH means the disk is still locked: vm-unlock infra, or the manual way of step 4.12. stopped means vm-up did not run: run it.

If you are away. Nothing can unlock the VMs remotely, and that is the price of R5. The admin VPN of step 10.11 ends on the UDM Pro, which is up: you can reach the network, but the Mac waits at its login window. A UPS for the Mac, the UDM Pro and the switch (chapter 2, “Things to have at hand”) is what makes this rare.

Why. Quitting UTM or restarting the Mac cuts a VM’s power in the middle of a write. vm-down asks each VM to shut down and waits.

Mac

Terminal window
ssh standby 'sudo ws-ctl status | head -3' # do not stop while the standby is serving a failover
vm-down # returns when all three are stopped
# ... restart, update, or whatever needed the stop ...
vm-up && vm-unlock all

Tell the Telegram group before a stop of more than two hours: the remote server announces an unreachable standby after that delay.

Verify. After vm-down: utmctl list shows three stopped. After the start: the checks of 15.1.

Why. Every image tag is pinned in vm/<vm>/.env.tpl, so nothing changes version until you say so, and the previous tag in Git is the way back.

Mac

Terminal window
VM=home # or infra
cd $INFRA && git checkout -b update-$(date +%F)
$EDITOR vm/$VM/.env.tpl # raise one version. Read its release notes first
scripts/vm-push.sh $VM
ssh $VM 'cd /srv/stack && docker compose --profile "*" pull -q && docker compose --profile "*" up -d && docker compose --profile "*" ps --format "table {{.Name}}\t{{.Image}}\t{{.Status}}"'

Then check the service itself, commit, and open a pull request:

Terminal window
scripts/check-secrets.sh && git commit -am "Update <service> to <version>" && git push -u origin HEAD

Rules by service:

Service Before After
Home Assistant Settings > System > Backups > Back up now. Read the release notes for breaking changes. Never skip more than one monthly release Settings > System > Repairs is empty, the HomeKit Bridge answers, one automation runs
Scrypted Step 12.6 (its own backup file) Every camera streams in the Home app. HomeKit Secure Video records an event
Matter server Home Assistant backup Matter devices answer in Home Assistant
AdGuard Home Nothing: its settings are in last night’s backup dig @10.0.2.5 debian.org answers, the query log moves
Insights Plus ssh infra 'sudo /usr/local/sbin/nas-backup' for a fresh dump. Never change SECRET_KEY The dashboard counts events within a minute
Grafana, Prometheus, Loki, Alloy, exporters Nothing Prometheus Status > Targets all up, Grafana opens
cloudflared Nothing curl -sI https://ha.example.com | head -1 from mobile data

Verify. The ps table shows the new tag and Up, and the service’s own check passes.

Rollback. git checkout main -- vm/$VM/.env.tpl, push and up -d again. For Home Assistant after a failed upgrade that changed its database: the same, then Restore the backup taken before.

One Sunday morning a month, in this order. The order matters: backups are checked before anything is changed, and DNS is the last thing to go down and the first to come back.

  • Backups first. Last night’s runs succeeded (step 12.5’s loop), Time Machine says today, Hyper Backup’s last run is green.
Terminal window
for VM in home infra; do ssh $VM 'printf "%s: last success %s\n" "$(hostname)" "$(date -d @"$(sudo cat /var/lib/nas-backup/last-success)" "+%F %R")"'; done
tmutil latestbackup
  • Announce. A line in the Telegram group, and ssh standby 'sudo ws-ctl status | head -3' shows standby.
  • Container updates you have decided on, one service at a time (15.3).
  • System packages on each VM. Security fixes install by themselves every night. This takes the rest, and the kernel that waits for a restart:
Terminal window
for h in standby home infra; do ssh $h 'sudo apt-get update -q && sudo apt-get -y dist-upgrade && sudo apt-get -y autoremove && [ -f /var/run/reboot-required ] && echo "$(hostname): restart needed" || echo "$(hostname): ok"'; done
  • Scrypted and UniFi files for the Mac’s backup (steps 12.6 and 12.8).
  • Stop the VMs, take their images, update the Mac.
Terminal window
vm-down
for VM in home infra; do rm -rf ~/infra-backups/vm-images/$VM.utm; cp -Rc ~/Library/Containers/com.utmapp.UTM/Data/Documents/$VM.utm ~/infra-backups/vm-images/$VM.utm; done
softwareupdate -l # install what you have decided on: sudo softwareupdate -i -a -R
brew update && brew upgrade && brew upgrade --cask utm 1password-cli

Stay one major macOS version behind for a few weeks after a release: UTM and Apple’s virtualization framework are what a new macOS breaks first.

  • Restart the Mac, log in, vm-unlock all, the checks of 15.1.
  • UniFi. Settings > Control Plane > Updates: install the Official releases of UniFi OS, Network and Protect, then the devices from UniFi Devices (switch, then access points). The house loses its network for a few minutes during the UDM Pro’s restart. Afterwards, run the test of step 10.5.
  • NAS. Swap the off-site USB disk (step 12.10). Glance at Storage Manager > HDD/SSD > Health.
  • A look around. AdGuard: Filters > DNS blocklists > Check for updates. UniFi: Insights > Flows filtered on Blocked, for a device that knocks on a door it should not. Grafana: disk and memory of the two VMs over 30 days. Home Assistant: Settings > System > Repairs.
  • Commit anything you changed in $INFRA.

Verify. Every box ticked, and the checks of 15.1 pass at the end.

15.5 Every quarter, every six months, every year

Section titled “15.5 Every quarter, every six months, every year”
When What Step
Quarterly Failover drill with the remote owner, and its line in the incident log 14.15 to 14.17
Quarterly Review the UniFi admin list, the WireGuard clients, and 1Password’s Watchtower 3.6, 10.11
Every six months Restore one file from restic and the Insights Plus dump. At the remote site, one old file from the standby’s history 12.11, 12.12
Every six months Read the open items of chapter 16 again: some close by themselves with new versions 16
Yearly Restore Home Assistant into a throwaway container 12.13
Yearly Renew what expires: the domain, the MaxMind license check, the Cloudflare API tokens if you set an end date. Rotate the backup account’s password on the NAS and in step 12.3’s files 9.1, 6.3, 11.5
Yearly Read this guide’s chapter 1 again and ask of each decision whether its reason still holds 1
Symptom First look Usual cause
No internet name resolves, everywhere dig @10.0.2.5 debian.org, then ssh infra 'docker ps' The infra VM is locked after a restart (15.1). Clients fall back to the gateway within seconds if step 6.11 gave them the second server
One site is blocked that should not be AdGuard Query Log, search the name, Unblock A blocklist. The unblock becomes a custom rule
Home Assistant unreachable from outside, fine at home ssh home 'docker logs --tail 20 cloudflared' The tunnel lost its registration: docker compose --profile remote-access restart cloudflared. Then Cloudflare’s status page
A camera is “No response” in the Home app Scrypted console of that camera, then Protect The camera, more often than Scrypted. Then the Scrypted Server Address of step 8.10 after an address change
Matter or Thread devices unavailable ssh home 'ip -6 route | grep -c "proto ra"' (at least 1) The VM lost its router advertisement route: sudo rdisc6 enp0s1 asks for a new advertisement, then step 7.9
A VM answers ping but not SSH, or is slow utmctl status <vm>, then its console with screen "$(vm-tty <vm>)" Out of memory (the console shows the kernel’s kill lines), or a disk at 100 %: “Growing a disk later” in chapter 5
The backup job failed ssh <vm> 'journalctl -u nas-backup -n 40 --no-pager' The NAS was restarting, or a firewall change (step 12.4’s error table)
Grafana or Insights Plus shows a certificate warning ssh infra 'docker logs --tail 20 caddy' A new Mac or browser that has not trusted the private authority: step 6.15
Telegram says BASCULE EFFECTUÉE ssh standby 'sudo ws-ctl status', then call the remote owner A real outage at the remote site. Do nothing on the standby: it is serving. The return is step 14.16, together
Telegram says the standby is unreachable 15.1 Your Mac restarted and waits for you
You locked yourself out of a VM’s SSH screen "$(vm-tty <vm>)", log in with the item VM <vm> user A change to sshd_config.d or to the firewall script. The console does not depend on the network
You locked yourself out of UniFi policies A cable into a port with the Default network, then https://10.0.1.1 A block placed above its allow. Pause the newest policy

Every change to configuration follows the same road, so that the repository always describes what runs:

  1. A branch in $INFRA.
  2. The change in vm/…, mac/… or scripts/…, and the matching line in this guide if a step changes.
  3. scripts/check-secrets.sh.
  4. scripts/vm-push.sh <vm> and the service’s own check.
  5. Commit, push, pull request, merge. The public site rebuilds from main by itself, after its check for personal information.

Settings made in a web interface (UniFi, AdGuard’s filters, Home Assistant’s integrations, Scrypted, DSM) are not in Git. Their record is this guide and their own backups: when you change one, change the step that describes it.

A restart costs you one login and one Touch ID. Updates happen when you decide, one service at a time, with a way back. An hour a month keeps backups proven, systems patched and the off-site copy fresh.