Deployment
On this page
Deployment#
Nix is designed to run on hardware you control. One command installs it on a machine with Docker, or into a Kubernetes cluster: see Install in one line. Both paths run the same container images, which CI builds for every commit on main and publishes to the GitHub Container Registry for linux/amd64 and linux/arm64:
Docker Compose on one machine. This is the default target, with a one-command release script that backs up, migrates and smoke-tests.
Kubernetes, with the sites services included. The manifests default to a small k3s cluster behind Cloudflare and take a few settings for any other cluster.
Start with the architecture, then pick a path.
How the pieces fit#
This diagram is shown as its source.
%% diagram
flowchart TB
Browser[Web app and installed app] --> Edge[Web container with Caddy]
CLI[nixctl] --> Edge
Agents[AI clients over MCP] --> Edge
Edge --> Core[Core API, with background jobs]
Edge --> Node[Node service: collaboration, companion, sites worker]
Edge --> MCP[MCP service]
Edge --> Store[(S3-compatible object store)]
Core --> PG[(PostgreSQL)]
Node --> PG
Node --> Core
MCP --> Core
Core --> Store
Core (ASP.NET Core) is the only permission authority. It owns items, properties, views and sign-in, and it runs the background jobs: imports, exports, calendar sync, push delivery and indexing.
The Node service runs collaboration, the pet companion and, when Sites is enabled, the sites worker, as roles of one process. Collaboration stores document edits and history, and assembles imports and exports.
The MCP service serves remote MCP at
/mcpfor AI clients. Every request carries its own token, and Core authorises each call. The installer always runs it, and Kubernetes runs it unless you turn it off; with Compose by hand it is optional.PostgreSQL holds all durable state, with row-level security, and runs full-text search.
The object store holds file bytes. Browsers reach it through short-lived signed links.
Sites, when enabled, adds a separate serving process for published websites.
In this section
Architecture and services
A Nix deployment is a handful of small services around one PostgreSQL database. Each has one job, and only Core decides...
Choosing a path
Both paths run the same images and the same database schema. They differ in what they include, how they are operated...
Requirements
Linux on amd64 or arm64. Docker Engine with Compose v2 that supports docker compose up --wait. Git, to check out the...
Docker Compose
The production manifest is deploy/compose.prod.yml in the repository. Images come from...
Kubernetes
The manifests in deploy/k8s/ run a complete Nix deployment on a Kubernetes cluster: the application, its database...
Images and tags
CI builds Nix's images in .github/workflows/ci-images.yml on every push to main, and on demand. Image Contents api Core...
Configuration
With Docker Compose, all production settings live in one private environment file, based on...
Backups
A Nix backup is only complete if it contains the database, the file bytes and the keys needed to use them. A database...
Upgrades
Every commit on main gets a full set of images, tagged with its full 40-character commit SHA, for linux/amd64 and...
Install in one line
The quickest way to run Nix is one command. With no argument it is a try-out on your own machine; with a public origin...