josh-a.dev blog ← Portfolio
On this page

My HomeLab Setup

What runs in my homelab, how it's wired up, and what I keep breaking along the way.

I run a headless box under my desk called saturn. It is a Debian 13 machine with six cores and 18 GB of RAM, and almost everything I self-host lives on it — my media, my notes, my photos, my passwords, and, as of this week, the site you are reading. This is the tour I wish I had when I started: what runs, how it is wired, and the parts that still keep me honest.

The box

It is not exotic hardware — an old desktop that had a spare SATA disk and a couple of free USB ports. It runs Debian 13 (trixie) headless, so there is no desktop environment and no keyboard in normal use. I administer it entirely over SSH from a laptop, which forces every change to be something I can do from a terminal and repeat next time.

Two disks matter. A 233 GB internal SSD holds the OS, the service config and the databases. Everything with real write traffic — media, downloads, caches, and most service data — lives on a 1 TB NVMe drive in a USB enclosure, mounted at /mnt/media. That split means a runaway download or a photo import cannot fill the disk the databases are breathing on.

What runs

A mix of native systemd services and Docker Compose projects, depending on what each one wants.

Installed straight on the host

  • Jellyfin — my media library.
  • Minecraft — a Paper server for friends, which is its own small adventure in Java versions.
  • Cockpit — a web console for quick checks.

In Docker

  • Nextcloud — files and sync, behind Caddy with a small internal certificate authority.
  • Immich — photos and video, with its own Postgres, Redis and machine-learning worker.
  • Vaultwarden — a Bitwarden-compatible vault for my passwords.
  • qBittorrent — routed through a gluetun WireGuard tunnel to a Mullvad exit, so nothing torrents if the tunnel drops.
  • Plex — the same library through a different app.
  • Homepage — a single dashboard that links the rest together.
  • This site — which gets its own section below.

The rule I settled on: something goes native if it wants the hardware directly or barely uses resources, and it goes in a container if it drags dependencies I do not want leaking onto the host. Immich is the clearest case — its database, cache and ML model all belong to it, not to me.

How it's wired

Remote access is Tailscale. None of the dashboards face the open internet: the firewall is nftables with a default-deny policy, and the only inbound paths are the LAN, the tailnet, and the one public tunnel below. A request from my laptop looks like this:

laptop  → tailnet  → 100.x address → service
laptop  → LAN      → 192.168.x.x   → service
internet → tunnel  → portfolio          (only josh-a.dev)

The storage layout matters here too. /mnt/media is a shared group called media with the setgid bit set, so new files inherit the group and Jellyfin, the torrent client and the backup jobs can all read what they need without me chowning things by hand.

Hosting this site

This portfolio is served from saturn too. It is the one service I deliberately expose publicly, and it is the smallest stack on the machine: an unprivileged nginx container serving a read-only bind mount of the site folder, and a cloudflared container that opens an outbound tunnel to Cloudflare. Because the tunnel is outbound-only and points at web:8080 on the internal Docker network, nothing has to accept inbound connections, and nginx never has to think about certificates or the public internet.

The nginx container is as locked down as I could make a container that serves files: read_only: true, all capabilities dropped, no-new-privileges, and a 128 MB memory cap. The site directory is mounted read-only, so a compromise gives an attacker a web root they cannot even write to.

Deploys are a fast-forward and nothing else. A CI key on the server is restricted with command= to run a single deploy.sh, so a leaked key cannot get a shell or read anything else — it can only run:

git fetch origin main
git merge --ff-only origin/main

The script refuses to run if local history has diverged from origin/main, and only ever advances forward. Since nginx bind-mounts the working tree read-only, a push to main goes live immediately with no container restart and no build step. It is the most boring deploy I could design, which is exactly the point.

What I keep breaking

The honest part.

  • TRIM does not work. The SSD sits on a USB controller that does not support the streams the UAS driver needs, so it falls back to the old usb-storage driver. No discard, and sustained write performance will degrade over time. The fix is hardware — moving the enclosure to a different controller — not a mount flag.
  • Immich and Nextcloud have no automated backups. Vaultwarden backs itself up nightly and Minecraft has a manual snapshot, but the two services holding the most irreplaceable data rely on me remembering. That is the next thing I fix.
  • The Minecraft console is dead. Paper replaces stdin with /dev/null, so op, save-all and friends have nowhere to go. The fix is RCON or a stdin FIFO; today I just edit files and restart.
  • The memory budget is tight. With 18 GB shared between two media servers, Immich's ML model and a pile of resident containers, every new service is a negotiation. I check free -h before raising any limit.

That is the whole setup. It is not clever, and it breaks in predictable ways, but every piece of it is something I can rebuild from a shell and understand end to end.