Home server → one VPS — eight containers moved, the home server switched off

NixOSMigrationConsolidationVPSRootless DockerPostgreSQLSelf-hostedPlatform Engineering
Image 1
Image 2
Image 3
Image 4
Image 5

Slides (PDF)

What it is

In January and February 2026 I'd built eight NixOS containers on a Proxmox host at home. A small VPS next to it ran the VPN and the VPN's control server.

In February I moved all eight to one dedicated VPS in Germany, in eight phases. The apps were back on the new server in three days (Feb 20–23). Then I switched the home Proxmox host off.

Zoom

Before

The eight containers each had one job:

  • databases
  • monitoring
  • a reverse proxy
  • a mail relay
  • a chat server
  • project management
  • a test environment
  • my portfolio

A ninth one, the media stack, went to the NAS instead, not to the new server.

It worked. It cost in three ways:

  • Always on. A 24/7 host at home for eight small containers.
  • Eight of everything. Eight profiles, eight deploys, eight sets of firewall rules. Every refactor patched eight things.
  • Public apps from inside the house. Public services reached the internet from my home network. A compromised container would have been a foothold on home equipment.

The move

Eight phases, numbered 0 to 7. Each phase was its own set of commits, so a bad change in one couldn't take the others down.

PhaseWhat
0Preparation: fixes on the old setup, the media stack moved to the NAS
1The new server: NixOS, full-disk encryption, SSH hardening
2The VPN's control server moved over, DNS switched to the new server
3App stacks: portfolio, test environment, project management, chat
4Home services: RSS, files, uptime monitoring, public ingress
5Monitoring pointed at the new server, alerts re-applied
6The eight old profiles archived, the home host switched off
7Docs and runbooks

The first commit for the new server is from Feb 20. The eight old container profiles were archived on Feb 23.

Choices I'd make again

One bigger server instead of several small ones. Two or three cheap providers would have spread risk and cost less. But the failure I'd actually lived with was complexity, not a host going down. The server has spare room, so I don't plan which service goes where. If it dies, the same NixOS profile rebuilds it on a new machine.

Rootless Docker for every container on the VPS. No exceptions. Containers run as my user, not as root, so a container escape doesn't land as root on the host. The cost: no low ports for containers (Nginx on the host proxies to them), and one DNS bug I got wrong for months (below).

Two ways in. Public apps go out through Cloudflare Tunnel. Internal tools are reachable only over my private VPN. Nothing at home has an inbound port forward.

Full-disk encryption. The passphrase is typed at boot. There was also a remote unlock path. I never used it, so I removed it in October and closed a port with it. SSH and admin tools are reachable only over the VPN.

What broke: my DNS fix never ran

In April, image pulls on the server started to fail:

Docker was asking localhost ([::1]) for DNS, and nothing answers there. I guessed the network layer cached a stale resolver, and added a weekly Docker restart on the VPS and the NAS.

In September I found that timer had never loaded, on either machine. The "fix" had never run once.

The real cause was different:

  1. Rootless Docker copies /etc when the daemon starts.
  2. On NixOS, those files are links into one generation of the system (one build of it).
  3. The weekly garbage collection deletes old generations, including that one.
  4. Inside the daemon, resolv.conf now points at nothing. Go treats a missing resolv.conf as "ask localhost", so [::1]:53.

Running containers never noticed, because Docker gives them DNS itself. Only new image pulls failed.

The fix: the daemon now follows the live generation instead of the one it started with, so garbage collection can't pull files out from under it. The weekly restart is gone.

Zoom

Since then

Zoom
  • Deploys run by themselves. A push goes to my own Git server, a build farm builds every machine, and the servers deploy themselves once a week. A smoke check runs after each deploy, a failure rolls back to the previous version, and the result goes to Telegram. Live since 2026-10-24.
  • One login. My own self-hosted single sign-on sits in front of the private web apps.
  • Alerts go to Telegram.
  • Fewer services. The chat server, an AI gateway and an RSS reader are archived, and some stacks moved to the NAS, where they start only when I need them.

Today

WhatState
Home serverOff since February 2026
Old small VPSGone; the VPN's control server runs on the new one
ContainersRootless Docker, every one
IngressCloudflare Tunnel for public apps, private VPN for internal tools
ExposurePublic apps through a tunnel; SSH and admin tools only over the VPN
DeploysWeekly, built by the farm, smoke check and rollback
ConfigOne NixOS profile in my flake rebuilds the whole server

Stack

NixOS, Nix flakes, rootless Docker, Docker Compose, PostgreSQL, PgBouncer, MariaDB, Redis, Nginx, Cloudflare Tunnel, Headscale, Tailscale, WireGuard, Prometheus, Grafana, Telegram alerts.

Status

In daily use. Private repo, the same flake as my-nixos-infrastructure.

Related: postgres-multi-tenant (the database pattern), vps-wireguard (the network), truenas-to-nixos-migration (the NAS side of the downsize), deploy-sh-guardrail (how deploys stay safe).