Home server, advanced: run it like a pro

One front door with HTTPS, containers that can't do much damage, networks that keep secrets apart, a server you can rebuild from Git, and alerts for the failures that make no noise.

Time ≈ 3–5 hoursLevel AdvancedCost a spare disk or PC for drills

Last updated December 2, 2026.

Before you start

This guide continues the intermediate guide. You should already have Docker Compose stacks in /srv/stacks, app data on its own disk, nightly restic backups (with a tested restore) and Tailscale.

An intermediate server survives accidents. An advanced server is easy to reason about: it has one front door, services that can't talk to things they shouldn't, a configuration you can rebuild from scratch, and alerts that tell you when something silently stops. That is what we build:

  • A reverse proxy with HTTPS and friendly local names instead of ip:port.
  • Alerts for silence: know when a backup stopped running, not only when a website is down.
  • Hardened containers and isolated networks, so one compromised app can't reach everything.
  • Your whole setup in Git, and a recovery drill you actually run.
  • Optional: redundant storage (RAID 1) for less downtime.
Advanced home server: one front door, isolated networks, alerts and a recovery plan Your devices reach every app through one reverse proxy that handles HTTPS and local names. Databases sit in an internal network with no way out. The server's configuration lives in a Git repository, and a push monitor alerts you when a nightly job silently stops. Your devicesphone, laptop, TVhttps://app.home.arpa Reverse proxyone front doorHTTPS + local names App containersread-only, no extra powersmemory limits, healthchecks Databasesinternal network: no way out Git repositorycompose files, no secretsrebuild in minutes Push monitorsilence = alertbackup, UPS, updates Recovery drillrestore on spare diskonce a quarter
The advanced server: a single front door, isolated networks, a configuration you can rebuild from Git, and alerts for silence.

Step 1: One front door with HTTPS and local names

Remembering 192.168.1.50:8096 doesn't scale. A reverse proxy listens on ports 80 and 443 and sends each name to the right container: jellyfin.home.arpa goes to Jellyfin, kuma.home.arpa to Uptime Kuma. It also gives every app HTTPS, so passwords never cross your network in plain text.

We will use Caddy because its configuration is tiny. home.arpa is the name reserved for home networks, so it never collides with a real website.

Terminal
mkdir -p /srv/stacks/caddy && cd /srv/stacks/caddy
docker network create proxy
nano compose.yaml
compose.yaml
services:
  caddy:
    image: caddy:2
    container_name: caddy
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./Caddyfile:/etc/caddy/Caddyfile:ro
      - /srv/appdata/caddy/data:/data
      - /srv/appdata/caddy/config:/config
    networks: [proxy]

networks:
  proxy:
    external: true

Then list your services in the Caddyfile. tls internal makes Caddy create its own private certificate authority, which is perfect for a network you control:

Caddyfile
kuma.home.arpa {
  tls internal
  reverse_proxy uptime-kuma:3001
}

jellyfin.home.arpa {
  tls internal
  reverse_proxy jellyfin:8096
}

Each app joins the same proxy network. In its own compose.yaml, remove the ports: lines (the proxy is now the only way in) and add:

in each app's compose.yaml
    networks: [proxy]

networks:
  proxy:
    external: true

Last piece: teach your network the names. In your local DNS (Pi-hole: Local DNS Records; most routers have a similar page) point every name to the server's LAN address. Then copy Caddy's root certificate and install it on your devices once, so browsers trust it:

Terminal
docker cp caddy:/data/caddy/pki/authorities/local/root.crt ./caddy-root.crt

Step 2: Alerts for silence

A monitor that checks "is the website up?" catches loud failures. The nastier ones are silent: the backup script stopped running three weeks ago, the UPS lost its connection, the disk filled up. Nothing is down, so nothing alerts.

The fix is a dead man's switch: the job reports "I'm fine" every time it finishes, and you get an alert when the report doesn't arrive. Uptime Kuma can do this with a Push monitor: create one, set the heartbeat to a little more than the job's interval (for a nightly job, 26 hours), and copy its push URL.

Then add one line at the end of your backup script, so it only reports success if restic succeeded:

/root/backup.sh
restic -r $REPO backup /srv/appdata /srv/stacks && \
  curl -fsS -m 10 "http://127.0.0.1:3001/api/push/YOUR_TOKEN?status=up&msg=backup-ok" > /dev/null

If the backup fails, the server is off, or cron stops, no heartbeat arrives and Kuma sends you a message. Use the same trick for anything periodic: certificate renewals, apt updates, a weekly restore check.

Step 3: Harden your containers

A container is not a fortress by default. A few lines in each compose file limit what a compromised app can do:

compose.yaml
    user: "1000:1000"                    # don't run as root (if the image supports it)
    read_only: true                      # the container can't change its own files
    tmpfs: [/tmp]                        # ...except a scratch folder in memory
    cap_drop: [ALL]                      # drop every extra Linux privilege
    security_opt: ["no-new-privileges:true"]
    mem_limit: 512m                      # a runaway app can't eat all your RAM
    healthcheck:
      test: ["CMD", "wget", "-qO-", "http://127.0.0.1:3001"]
      interval: 60s
      retries: 3

Not every image works with every option: some need to write somewhere (give them a volume or a tmpfs) or need one capability back (cap_add). Add the options one at a time, run docker compose up -d, read docker compose logs, and keep what works.

  • Pin versions. image: postgres:16 instead of latest; for important apps, a specific tag such as 1.23.16. Update on purpose, after a backup.
  • Never mount the Docker socket (/var/run/docker.sock) into an app unless you fully trust it: whoever controls it controls the whole server.
  • Secrets in files, not in the compose. Use .env with chmod 600, or Docker secrets for apps that support them.

Step 4: Isolate your networks

Inside Docker

A database should talk to its app and nobody else, and it should have no route to the internet. Docker can enforce that with an internal network:

compose.yaml
services:
  app:
    image: your-app:1.0
    networks: [proxy, backend]
  db:
    image: postgres:16
    networks: [backend]            # only on the internal network

networks:
  proxy:
    external: true
  backend:
    internal: true                 # no way out to the internet

Inside your house

Cheap smart plugs, cameras and TVs rarely get security updates. Don't let them share a network with your server and your laptop. Most routers offer a guest network or VLANs: put untrusted devices there, with "isolate clients" enabled, and keep a trusted network for your computers and the server.

Smart-home devices that must be controlled from the server (for example through Home Assistant) can live on their own network if you allow only that single connection from the server to them, never the other way around.

Step 5: Your server as code

If the server died today, could you rebuild it from memory? The goal here is that your compose files are the documentation, and they live in Git, so you can go back to any previous working version.

Terminal
cd /srv/stacks
git init
printf '.env\n*.key\n' > .gitignore       # NEVER commit secrets
git add . && git commit -m "First snapshot of my stacks"

Put a copy in a private repository (your own Git server such as Forgejo or Gitea, or a private repository on a hosting service). For every .env file, commit a .env.example with the variable names and fake values, so you remember what each one is for.

Then write a short README.md in the same repository: your disks, what mounts where, how the backup works, and the exact commands to bring everything back. That file is your runbook, and the next step puts it to the test.

Step 6: The recovery drill

A backup you haven't restored is a hope; a rebuild you haven't tried is a bigger one. Once a quarter, simulate losing the system disk, without touching your real server:

  1. Take a spare disk, a spare PC or a virtual machine, and install the same Linux with Docker.
  2. Clone your Git repository to /srv/stacks and recreate your .env files from your password manager.
  3. Restore the data from restic: restic -r /mnt/backup/restic restore latest --target / (on the test machine, with the backup disk attached).
  4. Start one stack at a time with docker compose up -d and open each app. Check that your data is really there: a photo, a recent note, a login.
  5. Write down every surprise in your runbook: a missing package, a forgotten password, a step that took ten minutes of guessing.

Time yourself. "My whole server is back in 90 minutes, from a laptop and a backup disk" is a very comfortable sentence to be able to say.

Step 7 (optional): Redundant storage with RAID 1

RAID 1 mirrors two disks, so the server keeps running when one dies. It does not replace backups: it only reduces downtime. Do this after everything above, and only with two disks of similar size.

Terminal
sudo apt install mdadm -y
sudo mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdX /dev/sdY
cat /proc/mdstat                         # watch the first sync
sudo mkfs.ext4 -L data /dev/md0
sudo mdadm --detail --scan | sudo tee -a /etc/mdadm/mdadm.conf
sudo update-initramfs -u

Mount it by UUID in /etc/fstab with nofail, as in the intermediate guide. Then make a failure visible: check cat /proc/mdstat ([UU] means both disks are fine, [U_] means one is gone) from a script that reports to your push monitor, so a degraded array alerts you instead of waiting for the second disk to die.

If something goes wrong

  • The name doesn't open: check the DNS record first (nslookup kuma.home.arpa), then docker compose logs caddy.
  • The browser warns about the certificate: the device doesn't trust Caddy's root certificate yet. Install caddy-root.crt on it.
  • A container won't start after hardening: remove the options and add them back one by one; the logs usually name the file it can't write.
  • The app can't reach its database: both must share a network (backend); the app also needs proxy if Caddy must reach it.
  • The push monitor alerts but the job ran: the heartbeat interval is shorter than the job's schedule, or the curl line never executed because a command before it failed.

You now run your home server the way small teams run theirs. From here the best next steps are the ones that fit your life: more services, a second site for backups, or sharing what you learned.