headcode

Docs · Installation

Your own server

One Rust binary with embedded Turso, bundled Better Auth, and standalone Next.js — on any Linux server, without Kubernetes or external databases.

Installation/Self-hosted

What runs

  • Backend: single-tenant Rust binary (~7–8 MiB RAM idle) with embedded Turso and a persistent /data volume for the .db file and /media
  • Auth: Better Auth on Node 26 + node:sqlite (shared across all your services, or started alongside Headcode via --profile with-auth)
  • Site: Next.js in standalone mode, or hosted on Vercel if you want edge caching

Quick start with Docker Compose or Uncloud

docker compose --profile with-auth up -d

Backups and moving hosts

Because each site stores its entire state in one Turso file plus /media, backups and migrations stay simple:

  • Backups: run an online VACUUM INTO snapshot and push it via encrypted restic to S3 (see infra/uncloud/backup.sh in mstack).
  • Moving servers: move one container and its .db file across your Uncloud WireGuard mesh with zero DNS propagation wait using the mstack-move skill.
  • 5-layer patching: unattended-upgrades for Linux, daily cargo audit + trivy CVE radar opening agent PRs, fast ARM64 builds, and uc deploy.

Let your coding agent run it

Prompt
Deploy Headcode CMS completely self-hosted on my ARM64 server using github.com/headcodecms/headcodecms
and the mstack skills in github.com/markustripp/mstack.
Use Uncloud with bundled auth, configure encrypted restic backups via VACUUM INTO to S3, and run smoke.mjs.

All compose profiles and environment variables are in the README. Try it locally first: it is the exact same binary.