Use Paprika
Docker
The Dockerfile at the root builds everything Paprika needs into one image: the Go server (MCP over HTTP and stdio, HTTP/WS API, SQLite), the web app (apps/web, with Tailwind) and the Rust/WASM renderer (crates/render), plus two sidecars: paprika-render, which draws render_screenshot and the raster exports without a browser (ADR 0012), and the team sync sidecar paprika-sync (crates/sync). There is no Chrome in it. Nothing else has to be installed on the host.
#Run
docker build -t paprika .
docker run -d --name paprika -p 127.0.0.1:4777:4777 -v paprika-data:/data paprika
# canvas: http://localhost:4777 · MCP: http://localhost:4777/mcpOr with Compose (same settings plus the hardening below, in compose.yaml):
docker compose up -d --buildConnect an agent exactly as with a local server: claude mcp add --transport http paprika http://localhost:4777/mcp.
#Run it hardened
The image is built to run with a read-only root file system and no privileges. compose.yaml already does this; with docker run it is:
docker run -d --name paprika -p 127.0.0.1:4777:4777 -v paprika-data:/data \
--read-only --tmpfs /tmp:size=256m,mode=1777 \
--cap-drop=ALL --security-opt no-new-privileges \
--memory 2g --pids-limit 512 \
paprika- Writable paths: two.
/data(the volume: database, tokens, undo history, team key) and/tmp(the private Unix socket ofpaprika-render). Everything else is read-only, and the binaries are0555. - No capabilities. The server binds port 4777 (above 1024), so nothing needs one.
--cap-drop=ALLleavesCapEff/CapBndat zero. - Non-root.
USER 65532:65532(numeric, so KubernetesrunAsNonRootcan verify it). A bind mount for/datamust belong to that uid:chown 65532:65532 ./data. A named volume is created with the right owner. - Memory and processes. With an empty database, the server uses about 12 MiB. It holds the active workspace in memory, plus the two workspaces read most recently (by a tab or an agent); one left alone for five minutes goes back to the database. A workspace costs much more in memory than on disk: one with 15,000 nodes (2.8 MB of JSON) takes about 75 MiB of Go heap with its undo history.
render_screenshotstartspaprika-renderon first use and keeps it; it holds one pixmap per screenshot (4 bytes per pixel, so 7.7 MB for a 1600x1200 frame) while it draws. That is why the examples allow 2 GiB and 512 pids. In a container, the server gives the Go heap a soft limit of 60% of the memory limit, so the garbage collector works harder before the kernel would kill it.GOMEMLIMIToverrides that limit. Past 80% of it, the server logs a warning, at most every ten minutes. - No shell, no package manager. The image has no
sh,apt,curlortar(its base is distrolessstatic). To look inside a running container usedocker cp/docker export; to debug the data, mount the volume in a throwaway container of your own. Do not add a shell to the image for it. - Stop.
docker stopsendsSIGTERM; the server shuts down by itself (exit code 0, well under a second). - Health.
HEALTHCHECKcalls/app/healthcheck, a small static client ofGET /api/health(there is nocurlto call). It checks port 4777; if you move the server (--port 5000), set-e PAPRIKA_HEALTH_PORT=5000(in Compose,healthcheck.test: ["CMD", "/app/healthcheck", "5000"]also works). For one-shot commands (mcp,import,export) pass--no-healthcheck.
#Team mode
compose.team.yaml turns on the peer-to-peer team sync (team-sync.md) on top of compose.yaml:
PAPRIKA_TEAM_NAME=Ana docker compose -f compose.yaml -f compose.team.yaml up -d --build- Name.
PAPRIKA_TEAM_NAMEis how the other members see you (defaultpaprika). - Key. The key, the team file, invites and the operation log live in
/data/paprika.team/, in the same volume as the database, so they survivedocker rmand upgrades. Back up the volume: losing the key means being invited again. - Network. The Iroh endpoint binds UDP
4778in the container. From Docker's NAT, peers still reach each other through relays; uncomment the4778:4778/udpport incompose.team.yamlfor direct connections. Only keys on the team's allowlist are accepted, but that port is open to whoever can reach the host. - Sidecar.
paprika-syncis at/app/paprika-sync. If the server says it cannot find it in the image, the image is broken or custom. - Back to local.
docker compose up -d(without the second file) starts the server without--team; the team data stays in the volume.
#Data, port, exposure
- Data. The SQLite database is
/data/paprika.dbinside the container (PAPRIKA_DB);/datais a volume, so documents, tokens and the undo/redo history survivedocker rmand image upgrades. Back it up withpaprika export(below) or by copying the volume. - Port. Keep the host port at 4777. The server only accepts requests whose
Host/Originislocalhost:4777,127.0.0.1:4777or[::1]:4777(its DNS-rebinding protection: a web page you visit cannot make your browser talk to a Paprika on another name), so-p 8080:4777answers403. To use another port, change both sides and the server's:-p 127.0.0.1:5000:5000 paprika serve --host 0.0.0.0 --port 5000(and the health check, above). - Exposure. Inside the container the server binds
0.0.0.0(it has to, for Docker's port forwarding). Publish it on the host's loopback (127.0.0.1:4777:4777, as above) unless you mean to share it: there is no authentication. - Variables.
PAPRIKA_DB(/data/paprika.db),PAPRIKA_WEB_ROOT(/app/web),PAPRIKA_SYNC(/app/paprika-syncis found next to the binary),PAPRIKA_RENDER(/app/paprika-render, found the same way).PAPRIKA_MCP_TOKEN(empty by default;compose.yamlpasses it through) makes/mcprequireAuthorization: Bearer <token>(mcp).
#Import, export and stdio
The image's entrypoint is the paprika CLI, so every command works with the same volume:
# import a .paprika.json into the volume's database
docker run --rm -i --no-healthcheck -v paprika-data:/data paprika import /dev/stdin < packages/e2e/fixtures/demo.paprika.json
# export the active workspace (stdout)
docker run --rm --no-healthcheck -v paprika-data:/data paprika export > design.paprika.json
# list workspaces
docker run --rm --no-healthcheck -v paprika-data:/data paprika listFor agents that only speak stdio:
{
"mcpServers": {
"paprika": {
"command": "docker",
"args": ["run", "-i", "--rm", "--no-healthcheck", "--read-only", "--cap-drop=ALL", "-v", "paprika-data:/data", "paprika", "mcp", "--no-ui"]
}
}
}Stop the HTTP container first if both would write to the same volume at once.
#Screenshots without a browser
render_screenshot (both renderers), /api/screenshot, export_image in PNG, JPEG, WebP and AVIF, compare_reference and fit_to_reference are drawn by paprika-render from a display list the Go core builds (ADR 0012). The result has painter: "paprika-render". It matches Chrome at 0.997 or more on every fixture board. What it does not draw, warnings names, grouped by rule:
- Text outside Inter. Only the embedded Inter weights are drawn; text in another family, with rich runs or a link is left out. Google Fonts are not fetched.
- Color filters.
saturate,grayscale,brightness,sepia,invertandhue-rotate(infilterorbackdropFilter) are drawn without their effect; the blur is kept. - A few shapes. A backdrop filter on an ellipse or a path, and remote, GIF and SVG images.
render_screenshot with renderer: "wasm" is drawn by paprika-render too; capturing the real canvas in a browser, and import_html with computed: true, need a Chromium, which the image does not have (and, with no libc, cannot run). Running Paprika from source with Chromium installed (PAPRIKA_CHROMIUM), those work, a screenshot that has nodes the sidecar does not draw goes back to Chrome by itself, and PAPRIKA_PAINTER=chromium sends every screenshot there.
#Targets
One image, on distroless static-debian13:nonroot. --target slim still builds it, for scripts that pass that name; runtime is the default. Its size is in the "Image sizes" step of the CI docker job (the old image with Chrome was 354 MB / 162 MB).
It runs as uid/gid 65532, like the images before it, so an existing volume keeps working.
Labels (org.opencontainers.image.source, .licenses, .version, .revision, .created) come from build arguments: docker build --build-arg VERSION=1.2.3 --build-arg REVISION=$(git rev-parse HEAD) . (Compose reads PAPRIKA_VERSION and PAPRIKA_REVISION). VERSION also sets the binary's version (paprika --version, MCP serverInfo.version); without it both say dev. Cutting a release: releases.
#How the image is built
# syntax=docker/dockerfile:1, BuildKit. The stages are independent, so the Rust, Go and Node builds run in parallel; each splits "dependencies" from "our code" so an edit to a source file rebuilds only the last step:
- wasm (
rust):cargo build --release --target wasm32-unknown-unknown+wasm-bindgen(release binary, checksum-pinned, same version and checksum as.github/actions/setup-rust-wasm). Dependencies compile first against an empty crate (a layer keyed byCargo.toml/Cargo.lock/.cargo/config.toml, which turns on WASM SIMD), then the crate itself. The stage fails ifWASM_BINDGEN_VERSIONdiffers from the=pin incrates/render/Cargo.toml. - sync (
rust+musl-tools): the sidecarpaprika-sync, a static musl binary with symbols stripped and build paths remapped (through cargo's environment, notCargo.toml), same dependency split. render (rust+musl-tools): the render sidecarpaprika-render(--features server), built the same way;build.rscompilesproto/render/v1/render.protowithprotox, so noprotocis needed. - web (
node, pnpm frompackageManager, checked):pnpm install --frozen-lockfile --ignore-scripts --filter @paprika/web...with the pnpm store in a cache mount, thenpackages/corebuild andvite buildwith the WASM from stage 1 copied toapps/web/src/wasm. It checks thatdist/client/_shell.htmland a.wasmexist. - server (
golang): modules in one layer, the compiled third-party packages in the next (their list comes fromgo list -deps), then the server itself;CGO_ENABLED=0 -tags nodynamic -trimpath -ldflags "-s -w"(modernc.org/sqliteis pure Go; webp/avif stay on WASM so purego does not pull libc). A cache mount seeded from that layer keeps local rebuilds at a few seconds. The healthcheck client is a small program written out in the same Dockerfile. - slim / runtime (distroless
static): binary at/app/paprika(and/app/paprika-syncnext to it, found byserve --team, and/app/paprika-render), canvas at/app/web(PAPRIKA_WEB_ROOT).
.dockerignore is an allowlist: the build context only carries what the stages copy (tests, test fixtures and the other apps stay out, so editing them never invalidates a layer). The context is 5.6 MB.
Base images and downloads are pinned: every FROM is name:tag@sha256:digest; wasm-bindgen and pnpm (the npm tarball) are ADD --checksum.
#Keeping the pins up to date
- Base image digests. Dependabot (
dockerecosystem in.github/dependabot.yml) updates the tag and the digest in theFROMlines together. By hand:docker buildx imagetools inspect <image>:<tag> --format '{{.Manifest.Digest}}', then replace the@sha256:part. - Overriding a base (a mirror, an internal registry, a CA injected for a proxy): the name to override is the full pinned reference:
docker buildx build --build-context rust:1.100-slim-trixie@sha256:<digest>=docker-image://<other> . - wasm-bindgen.
wasm-bindgen = "=…"incrates/render/Cargo.toml→WASM_BINDGEN_VERSIONand its checksum in thewasm-bindgen-tgzstage and in.github/actions/setup-rust-wasm(the build checks the first two against each other; Dependabot ignores that crate). - pnpm.
packageManagerinpackage.json→PNPM_VERSIONand the checksum in thepnpm-tgzstage (the build fails if the version differs; the checksum iscurl -sL https://registry.npmjs.org/pnpm/-/pnpm-<version>.tgz | sha256sum). - Go. The
golang:tag must be at least thegoline ofserver/go.mod(GOTOOLCHAIN=localstops the toolchain from downloading another one). - Node. The
node:tag follows theenginesfloor and what CI uses.
#CI
The docker job of .github/workflows/ci.yml lints the Dockerfile with hadolint, builds the image with a layer cache in the GitHub Actions cache, and runs .github/scripts/docker-smoke.sh against it. The smoke test runs the image hardened (--read-only --cap-drop=ALL --security-opt no-new-privileges, memory and pid limits) and checks: numeric non-root user, no shell, the HEALTHCHECK turning healthy, no capabilities left, the canvas and WASM asset served, foreign Host refused, MCP initialize + tools/list + create_nodes + render_screenshot (drawn by paprika-render, with no warnings) + export_image over /mcp, /app/paprika-sync present and 0555, the database surviving a container restart, team mode (sidecar up, key kept on the volume) and a clean docker stop in under 8 seconds. It runs when the PR touches the Dockerfile, .dockerignore, compose.yaml, or anything that goes into the image (server/, apps/web/, crates/render/, crates/sync/, packages/core/), plus on full runs. See ci.md.
Run the same checks locally (the port must be 4777):
docker build -t paprika:dev . && .github/scripts/docker-smoke.sh paprika:dev