No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-18 23:02:31 +00:00
beszel Initial commit: small-scale, rootless, production-ready compose stacks 2026-11-18 22:54:11 +00:00
caddy Initial commit: small-scale, rootless, production-ready compose stacks 2026-11-18 22:54:11 +00:00
continuwuity Initial commit: small-scale, rootless, production-ready compose stacks 2026-11-18 22:54:11 +00:00
copyparty Initial commit: small-scale, rootless, production-ready compose stacks 2026-11-18 22:54:11 +00:00
forgejo Initial commit: small-scale, rootless, production-ready compose stacks 2026-11-18 22:54:11 +00:00
runner README: isolation options — one daemon or several (measured idle cost) 2026-11-18 23:02:31 +00:00
syncin Initial commit: small-scale, rootless, production-ready compose stacks 2026-11-18 22:54:11 +00:00
syncthing Initial commit: small-scale, rootless, production-ready compose stacks 2026-11-18 22:54:11 +00:00
vaultwarden Initial commit: small-scale, rootless, production-ready compose stacks 2026-11-18 22:54:11 +00:00
.gitignore Initial commit: small-scale, rootless, production-ready compose stacks 2026-11-18 22:54:11 +00:00
LICENSE Initial commit: small-scale, rootless, production-ready compose stacks 2026-11-18 22:54:11 +00:00
README.md README: isolation options — one daemon or several (measured idle cost) 2026-11-18 23:02:31 +00:00

compose

Production-ready, small-scale Docker Compose configurations — for people who want their own forge, file share, password manager or chat server on one small VPS, without running Docker as root and without copying a 2,000-line "enterprise" stack from a blog post.

Every directory here is a single self-contained stack: a compose.yaml, an env.example, and a README that explains not just how to start it, but what will bite you in week two.

These are the configs we actually run. They are tuned for a 2 vCPU / 2 GiB box, because that is the interesting case: if a stack only works on a 16 GiB machine, it isn't "lightweight".


The rootless Docker habit

All stacks here assume Docker running rootless, as an unprivileged user (call it dockersvc). Nothing in them requires the root daemon.

Why bother:

  • The docker group is root. On a classic root daemon, anyone who can talk to /var/run/docker.sock can start a container with -v /:/host and own the machine. Running the whole stack as a normal user removes that trap instead of documenting it away.
  • Blast radius. A compromised service can reach the rest of that user's containers and its own data — not the host's /etc, /root or other users' files.
  • No root daemon to babysit. No systemctl restart docker that silently takes every workload down, no daemon.json incident, upgrades are per-user.

Setting it up once (Debian/Ubuntu; the packages are uidmap, dbus-user-session, slirp4netns):

sudo loginctl enable-linger dockersvc          # start without a login session
sudo -u dockersvc dockerd-rootless-setuptool.sh install
# then, in dockersvc's environment:
export XDG_RUNTIME_DIR=/run/user/$(id -u)
export DOCKER_HOST=unix:///run/user/$(id -u)/docker.sock

Pin the network driver to slirp4netns — the gvisor-tap-vsock default dropped 10–50 % of new container connections under load in our tests, which looks like a randomly flaky app and is maddening to debug:

# ~/.config/systemd/user/docker.service.d/10-network.conf
[Service]
Environment="DOCKERD_ROOTLESS_ROOTLESSKIT_NET=slirp4netns"

What rootless costs you (and how each stack deals with it)

Symptom Cause What to do
Container can't write its bind mount The image runs as uid 1000, which maps to a subuid outside the user namespace Run the container as user: "0:0" (container root is your unprivileged user) or chown the host dir from inside a container
ls -l data/ shows a huge number instead of your user Subuid ownership Inspect and back up those dirs with sudo
Monitoring agent sees no NICs/SMART/temperatures Rootless containers can't read host hardware Run the agent on the host, or accept CPU/RAM/disk only
A bind-mounted /etc/localtime goes stale The rootless daemon copies up /etc at start Set TZ: Etc/UTC in the container instead of mounting the file
Port 443 unusable Unprivileged users can't bind < 1024 Let the rootless proxy handle it, or terminate TLS on a proxy/Tailscale Serve

Isolation: one daemon or several

The stacks here assume one unprivileged user running one rootless daemon. That is the cheapest model, and on a small box it is usually the right one — but it is not the only option, and it matters more than it looks.

What one daemon means. Every container of that user shares the same daemon and the same user namespace. Anything that can reach the Docker socket can exec into every sibling container and read every data/ directory. A user: line in a compose file does not change that. Most stacks are fine with it; the ones that mount the socket (the CI runner) or that face the internet are the ones worth thinking about.

Splitting by user. Each Unix user can run their own rootless daemon with its own socket, its own data root and its own user namespace. A service that lives under vaultd cannot see, or be seen by, a container under gitd — a compromise stays inside one user. That is a real boundary, not a configuration detail.

Model Isolation Idle cost Use when
One user, one daemon (default) shared fate one daemon ≤ 4 GiB, services equally trusted
Daemon per trust domain separate UIDs, sockets, networks ≈ +130 MiB per daemon ≥ 8 GiB, or one service is exposed/untrusted
Podman rootless, per user same UID separation, no daemon no idle daemon (containers are systemd units) you like systemd and not daemons
VM / LXC per service strongest 150 MiB+ per guest, plus kernel big boxes, hostile workloads

The ≈130 MiB above is measured, not guessed: dockerd 68 MiB + containerd 37 MiB + rootlesskit 16 MiB + slirp4netns 8 MiB, idle, with no containers running. On a 2 GiB box that is 6 % of RAM before the first container starts — which is exactly why "one daemon" is the pragmatic default at this size. It grows with image pulls and builds.

Adding a second rootless daemon

sudo useradd -m -s /bin/bash vaultd
sudo loginctl enable-linger vaultd
sudo usermod --add-subuids 100000-165535 --add-subgids 100000-165535 vaultd
sudo -iu vaultd dockerd-rootless-setuptool.sh install

# every stack works unchanged — just point the client at that user's socket
sudo -u vaultd env DOCKER_HOST=unix:///run/user/$(id -u vaultd)/docker.sock \
  docker compose up -d

Two things to plan for when you split:

  • Ports. All daemons share the host's loopback, so two daemons cannot publish the same port. Keep a port map; the stacks here use distinct ports by default.
  • Disk and backups. Each user gets its own image store, and its own data/ trees — now spread across several homes instead of one directory.

What this does not buy you

  • It is UID isolation, not a hypervisor. A kernel exploit still crosses it; treat it as defence in depth, not as a reason to skip patching.
  • It does not stop a container from being reached over the network if you publish its port on the same interface — that is what loopback-only ports and a reverse proxy are for.
  • The strongest cheap win, if you only split once: give the stack that holds the Docker socket (CI) its own daemon, and keep the vault inside it too.

Conventions in this repo

  • One directory per stack, named after the service: forgejo/, vaultwarden/, …
  • compose.yaml — pins an explicit image tag (never :latest), sets restart: unless-stopped, a healthcheck where the image allows one, log rotation, and a mem_limit sized for a 2 GiB box.
  • env.example — every variable the stack reads, with safe defaults. Copy to .env (mode 600). .env is gitignored, here and in your install.
  • README.md — what it is, how to reach it, and the gotchas.
  • Server layout — one directory per stack, mirroring this repo:
/srv/<stack>/
├── compose.yaml
├── .env                 # secrets, 0600
├── data/                # bind-mounted state
└── <extra config files>

Network policy

Published ports bind 127.0.0.1 only. Nothing here opens a hole in your firewall by itself. Pick how you expose it:

  • Public, with TLS — a reverse proxy on the host (Caddy, nginx). See caddy/Caddyfile.example. Remember to trust the proxy's forwarded headers in the app (most stacks here already set that).
  • Private, over a WireGuard mesh (Tailscale) — terminate TLS with tailscale serve and keep the public IP closed:
tailscale serve --bg --yes --https=8443 http://127.0.0.1:8222   # HTTPS on the tailnet
tailscale serve --bg --yes --tcp=22000 tcp://127.0.0.1:22000    # raw TCP forwarding

That one trick is why half of these stacks can be "production ready" on a box with no public exposure at all: Vaultwarden, Syncthing, the file server and the monitoring agent never listen on the internet.

The stacks

Stack What it gives you Loopback ports Expose via
forgejo Git forge: repos, issues, PRs, package registry, Actions 3000, 2223 (SSH) reverse proxy + TCP forward
runner Forgejo Actions runner (CI jobs in containers) — outbound only
vaultwarden Bitwarden-compatible password manager 8222 Tailscale Serve / proxy
syncthing Peer-to-peer file sync 8384, 22000 Tailscale Serve + TCP forward
copyparty File server: web UI, WebDAV, SFTP, resumable uploads 3923, 3922 Tailscale Serve
continuwuity Matrix homeserver (Conduit-compatible) 8008 reverse proxy
syncin Nextcloud-style file sync + collaboration (Node + MariaDB) 8080 reverse proxy / Tailscale Serve
beszel Monitoring agent for the Beszel hub 45876 Tailscale only
caddy Example reverse-proxy config for the public stacks 80, 443 —

Read the stack's own README before running it. They are short, and the last section ("gotchas") is the part that saves you an evening.

What is deliberately not here

  • Backups. Every stack has a data/ directory with a database or an index in it. Back those up like you mean it — this repo is not a backup strategy.
  • Monitoring glue. Healthchecks, dead-man pings and alert routing are environment-specific; only the components themselves are here.
  • Secrets management beyond .env. For one box, a 0600 .env is honest and sufficient. If you grow past that, use Docker secrets (*_FILE) or your platform's secret store — several stacks already accept *_FILE.
  • Hardening beyond Docker. Firewall, SSH, unattended upgrades and the host's own patch cycle are your job. Rootless Docker is one layer, not the whole sandwich.

Versions and maintenance

Image tags are pinned on purpose. There is no automation watching upstream releases: we bump a stack when we roll it on our own box, and the READMEs carry the upgrade notes we needed at the time. Treat what you find here as known-good configurations, not as a CVE feed — check the upstream advisories yourself.

License

Our configuration files, documentation and scripts in this repository are licensed under the Apache License 2.0 (see LICENSE).

Each stack is a deployment configuration for a third-party project, and those projects keep their own licenses — see the "Upstream" section of each stack's README and respect them (they range from MIT to AGPL-3.0; if you redistribute a modified stack, the upstream terms still apply to the software itself).