← Back to portfolio

01 / Case study

Homelab

Four machines spread over two physical networks I do not fully control, joined by a private WireGuard overlay instead of open ports. One host is always on. The rest join the tailnet from wherever they happen to be, and the whole thing is built to survive a dead link without lying about it.

Scope
Four Linux systems and admin devices
Networking
Tailscale peer-to-peer mesh, no router forwards
Deployment
Per-service Docker Compose with pinned image CI
Restore drill
Documented for a second machine, not yet run

What runs where

The lab started as one Ubuntu box and grew into a small distributed system. The home server is the only machine that stays on by design. It runs the services I actually depend on: photo backup, media, dashboards, monitoring, and the Mission Control hub. Everything else contributes compute when it is awake and drops off the tailnet when it is not.

4hostsTwo physical networks
0Inbound router ports
3Published Compose templates
2012Oldest CPU still in service
HostHardwareRole
Ubuntu home server Intel Core i5-3570K, NVIDIA GTX 1050 Ti, SSD plus a 2 TB HDD Always-on Docker host. Immich, Jellyfin, Plex, Homepage, Wallos, Cockpit, Prometheus, Grafana, Loki, Alloy, Alertmanager, and the Mission Control dashboard.
CachyOS desktop Intel Core i5-13600KF, AMD Radeon RX 9070 with 16 GB VRAM, 24 GB DDR4 Daily workstation, local AI experiments (currently paused), on-demand game servers, and the machine used for restore drills. One RAM stick failed in November 2026, which took the system from 32 GB to 24 GB.
Ubuntu laptop node Intel Core i3-1215U, 16 GB RAM, Ubuntu 24.04 LTS Secondary Docker host. Runs node-exporter, cAdvisor, Alloy, Cockpit, a Mission Control agent, and occasional game servers.
Raspberry Pi 5 4 GB model NAS proof of concept. Small enough to test the idea without pretending it is production storage. There is a short walkthrough on video.
Admin devices Laptop, tablet, and phone Administration and service access over the tailnet, from home Wi-Fi or cellular.

Two networks, no port forwards

The home server sits alone on my residential LAN. The desktop, laptop, Pi, and admin devices live on separate wired and Wi-Fi networks that are managed by someone else, so there is no shared Layer 2 broadcast domain and no assumption that the remote machines can reach each other locally. Tailscale is the only common network.

Logical topology
InternetUntrusted side
Home routerNAT, zero inbound forwards
Home serverOnly always-on host on the home LAN
Playit tunnelExactly one game port, on demand
Game serverDesktop or laptop node
Tailscale overlayDesktop, laptop, Pi, admin devices, home server. Peer to peer.
  • The home router forwards no inbound ports. Remote access is the overlay's job, not the router's.
  • The home server is a normal Tailscale peer. It does not advertise subnet routes and it is not an exit node, so a compromised peer cannot pivot into the home LAN through it.
  • A Playit tunnel handles one game-server port when an on-demand server is running. It reaches that port and nothing else, so the game server can be public without the rest of the lab being public.
  • Admin devices reach services through Tailscale Serve, which terminates HTTPS for the tailnet, and through SSH scoped by the host firewall.

Isolation with Compose

Each stack is its own Compose project under a service directory on the server, so a bad config or a restart only takes down that stack. Bridge networks keep stacks apart where they can be kept apart, and host networking is reserved for the cases that genuinely need it: Plex local discovery, Jellyfin, and the exporters that have to read host state. Services that do not need to be public publish to loopback, and Tailscale Serve puts HTTPS in front of them. Grafana, Prometheus, Loki, and Alertmanager bind to the tailnet address instead of every interface, and UFW limits SSH and admin ports to the tailnet or the local network.

Images are pinned. A CI check parses each Compose file and fails on floating tags such as latest, so a routine rebuild cannot silently swap the software underneath a service. That check is boring, which is the point.

Published templates are not the live deployment. The repository publishes three sanitized Compose templates: Immich, Plex, and Jellyfin. The live lab runs more services than that, with real values in .env files that never enter the repo. Relative binds like ./config resolve against whichever directory a stack runs from, so the same line means a different absolute path on the server than in a restore clone.

One old GPU, several jobs

The GTX 1050 Ti does two things that used to need two machines. NVENC handles Jellyfin and Plex transcodes, and CUDA handles Immich's machine learning for things like face and object detection. Sharing one card means those workloads compete for the same silicon, so the design favors hardware transcoding for the common case and keeps the ML jobs small. It is also why the server stays on older, lower-power hardware instead of chasing 4K transcode counts it cannot cool or power comfortably.

CPU load is the other constraint. An i5-3570K is not fast in 2026, but it idles cheaply and handles a handful of containers without drama. Most of what the box does is I/O and waiting, which is exactly the workload old hardware is still good at. Keeping a 2012 desktop CPU and a Pascal-era GPU in service is the whole argument for reusing hardware instead of replacing it: the workload has to match the part, and this one does.

Storage: SSD for state, HDD for bytes

The split is deliberate. The SSD holds things that are expensive to rebuild or need random reads: container layers, service configs, databases, thumbnails, and transcode scratch. The 2 TB HDD holds the bulk data that would hurt to lose but is read sequentially: Immich originals and the media library.

DataWhere it livesWhy
Immich originals2 TB HDDThe only copy of the photos. Large, sequential, and backed up separately.
Immich databaseSSD, inside PostgresAlbums, faces, users, and metadata. Losing it means re-importing everything.
Thumbnails and encoded videoSSDRegenerated from originals, so they are scratch data and are not backed up.
Plex and Jellyfin configsSSDWatch history, libraries, and users. Small and worth a nightly copy.
BackupsA separate driveNot the SSD and not the media HDD, so one dead disk does not take the backup with it.

Observability on two levels

Metrics and logs live on the home server: Prometheus scrapes node-exporter, cAdvisor, and blackbox probes; Alloy ships logs to Loki; Grafana draws the dashboards; Alertmanager routes what is worth waking up for. Cockpit gives each Linux host a local admin view. On top of that, Mission Control polls every node across the tailnet and puts CPU, GPU, memory, storage, and container state on one page.

Having both is intentional. Prometheus answers historical questions and keeps retention. Mission Control answers the one question I ask most often, which is whether all the boxes are up right now. You can read about how it handles stale data in the Mission Control case study.

  • Host availability, disk pressure, container health, and endpoint probes are the four alert categories that matter day to day.
  • Logs are shipped off the containers so a crashed service still leaves evidence behind.
  • The dashboard and the alerting path are separate, so a broken UI does not hide a dead host.

Backups, and the restore that has not run yet

The rule I work from is simple: a backup only counts once a restore from it has worked. The backup set covers the Immich database with pg_dumpall, the original photos with rsync, and the Plex and Jellyfin configs with tar while those services are stopped. Each stack's .env goes into the set too, stored encrypted, because a restored stack without its environment is not restored.

Two details came out of getting this wrong in small ways. The database dump runs before the file copy, so a photo uploaded between the two steps has a file but no row, which is harmless. The other order leaves a row pointing at a missing file. Every script also runs with set -euo pipefail, because without pipefail a failed pg_dumpall | gzip produces a small, valid-looking archive of an error message.

Pre-flight before anything is copied

A mount inventory check reads the live containers with docker inspect and fails when a required source is missing. It also fails when Immich has an upload bind the backup set does not account for, since that mount could hold the only copy of user data. Two upload binds are still not covered. The check refuses to let a drill proceed for a set that ignores them, so they have to be added or explicitly written off first.

The drill runs on a second machine

The restore test runs on the desktop in a dedicated clone, never on the server. The Compose files set fixed container and project names, so restoring next to the live stack would collide with it or overwrite live data.

  1. Verify the backup set against its SHA256 sums. Every line has to say OK.
  2. Copy each service .env into its stack folder and point the tailnet address at the desktop.
  3. Repoint the Immich library volume at the restored photo folder.
  4. Remove the NVIDIA device reservations and the CUDA image tag, because the desktop has an AMD card and Docker will not start a container that reserves a GPU it cannot find.
  5. Start Postgres, poll pg_isready instead of sleeping, then import the dump with ON_ERROR_STOP so the first SQL error ends the drill.
  6. Restore the profile images, bring the stack up, and check the pass criteria: normal login, photo count matches the live server, five random photos including a video open at full size, and albums and named people are present.

Cleanup is scoped to the drill directory and its Compose projects. Nothing in the cleanup path touches the live service directories.

Status, plainly: the backup and restore procedure is written, the pass criteria are defined, and the drill has never been executed. As of this writing the restore log has no rows. Until one does, treat the backups as untested.

What I took from running it

  • Old hardware is still useful when the workload is I/O and idle time. The 2012 CPU has outlived two newer machines' worth of assumptions about what a home server needs.
  • Closing inbound ports removes a whole category of problems, but it does not remove the need for authentication. The overlay is the perimeter, not a substitute for authentication.
  • Pinning images and checking mounts are unglamorous controls that prevent the failures that are hardest to debug later.
  • Writing the restore steps exposed gaps the backup script hid, which is the main argument for doing the drill even when the backup looks fine.