Cloud-agnostic notes for running every tier in production: any container platform (Kubernetes, ECS, Nomad, or plain VMs with Docker), a Postgres 18 compatible database, and an S3-compatible object store. Related docs: architecture in overview.md and ADR 0021 (topology); images in ADR 0903; footprint in build.md; security controls in security.md.
docker-compose.prod.yml is a working single-host version of everything below, minus TLS and replicas. Read it next to this page.
Internet ── TLS 1.2+ (HSTS) ── Edge LB ──┬── /v1/realtime?file=F ── hash(F) ──► realtime instances (L4/WSS, PROXY v2)
├── /v1/* ─────────────────────────► api replicas (stateless)
├── /mcp ─────────────────────────► mcp replicas (optional, hosted agents)
└── /* ─────────────────────────► web (static; or a CDN)
Private network only:
api ── ws ──► internal realtime LB (same hash(F) routing) ──► realtime (HTTP op batches, ADR 0303)
api ── http ──► doc workers (the API picks one by rendezvous hash of pageId; no LB, ADR 0304)
doc workers ── ws ──► internal realtime LB (follow live pages)
compactor processes ── Postgres + blob store (job queue, FOR UPDATE SKIP LOCKED)
every tier ── Postgres (own role) ; api/realtime/docworker/compactor ── blob store
Prometheus ──► metrics ports (never routed by the edge)
| Tier | Image / command | Replicas | Routed by | Ports |
|---|---|---|---|---|
| web | web (nginx, uid 101) |
2+, or a CDN in front | any | 8080 |
| api | api |
2+, stateless | any (round robin) | 8787 public, 9465 metrics |
| realtime | realtime |
1 per box (8 vCPU / 16 GB target, ADR 0020) | file id (consistent hash of ?file=) |
8788 public WS + /healthz, 9464 metrics |
| doc workers | docworker (--mode=worker) |
N, private | the API hashes pageId over LINORA_DOCWORKER_URLS |
8790 private, 9466 metrics |
| compactor | docworker with --mode=compactor |
1+ (a long-running job loop), plus 1+ large-memory compactor for big pages | none (claims jobs) | 9467 metrics |
| mcp | mcp (LINORA_MCP_TRANSPORT=http) |
1+, stateless sessions per agent | any | 8789 |
| migrate | api image: --no-strip-types packages/server-common/src/migrate.js |
run once per release | - | - |
Realtime routing is the one hard requirement. Every socket of a file must reach the instance that owns its rooms, from browsers and from the API and doc workers too. Hash fileId on the file query parameter with a consistent hash (HAProxy balance uri/hash-type consistent on the param, nginx hash $arg_file consistent, Envoy ring hash or Maglev). Adding an instance then moves only ~1/N of files; their clients reconnect and catch up. Put the same rule on an internal listener for LINORA_REALTIME_INTERNAL_URL, which the API and doc workers use.
The compactor is a job, not a service. Each process claims one page at a time, exits 75 after LINORA_COMPACTOR_MAX_JOBS jobs or above its memory cap, and expects to be restarted (restart policy always, or a Deployment). Scale by process count; claims use SKIP LOCKED. A scheduled job (CronJob) also works if it runs often enough to keep tails short (tail thresholds in doc-workers.md).
Build from the repo root: docker build -f deploy/Dockerfile --target <api|realtime|docworker|mcp|web> ..
NODE_ENV=production (ADR 0902/0903).HEALTHCHECK (/app/healthcheck.mjs <tier>) is for Docker. Orchestrators should probe the HTTP endpoints directly (see Health and readiness).All settings come from the environment. Tiers refuse to start when a required setting is missing or invalid and report every problem at once (ADR 0023). With NODE_ENV unset or production, the defaults are secure: Secure __Host- cookies, HSTS, no default origins, info logs, invite-only signup. A production tier also refuses the development credentials this repo publishes (the dev DATABASE_URL password and S3 secret from .env.example, docker-compose.yml and CI; ADR 0906). LINORA_ALLOW_DEV_SECRETS=1 lifts that for tests and benchmarks only; never set it in a deployment.
| Variable | Tiers | Production value |
|---|---|---|
DATABASE_URL |
all but mcp | the tier’s own login (see Database roles); migrate uses the owner |
LINORA_TOKEN_KEYS_RT |
api, realtime | derived keyring (see Secrets) |
LINORA_TOKEN_KEYS_CG |
realtime | derived keyring |
LINORA_TOKEN_KEYS_SVC_API |
api, docworker | derived keyring |
LINORA_TOKEN_KEYS_SVC_DOCWORKER |
docworker, realtime | derived keyring |
LINORA_BLOB_STORE, LINORA_S3_ENDPOINT, LINORA_S3_REGION, LINORA_S3_BUCKET, LINORA_S3_ACCESS_KEY_ID, LINORA_S3_SECRET_ACCESS_KEY, LINORA_S3_FORCE_PATH_STYLE |
api, realtime, docworker, compactor | s3, your endpoint and bucket. Give the compactor a read-write bucket user and the readers (api, realtime, docworker) a read-only one; with local, mount the blob directory read-only in the readers (ADR 0906) |
LINORA_TRUSTED_PROXIES |
api, realtime | CIDRs of the LBs (and the hosted MCP) whose X-Forwarded-For / PROXY header is honoured |
LINORA_API_HOST / LINORA_REALTIME_HOST / LINORA_DOCWORKER_HOST |
api / realtime / docworker, compactor | 0.0.0.0 in a container (the docworker default is 127.0.0.1) |
LINORA_API_METRICS_HOST, LINORA_REALTIME_METRICS_HOST, LINORA_DOCWORKER_METRICS_HOST, LINORA_COMPACTOR_METRICS_HOST |
each tier | private interface, or 0.0.0.0 in a container that sits only on a private network whose metrics port is never published or routed (SR-18). A container that is also on a client-facing network (the prod-like api and realtime) keeps the 127.0.0.1 default (ADR 0906) |
LINORA_REALTIME_URL |
api | public wss://app.example.com (returned to clients in realtime tokens) |
LINORA_REALTIME_SAME_ORIGIN |
api | 1 when the edge serves /v1/realtime on every allowed origin: a token requested from an allowed origin then carries that origin’s own ws(s):// URL, others get LINORA_REALTIME_URL (ADR 0905). Off by default |
LINORA_REALTIME_INTERNAL_URL |
api, docworker | internal realtime LB, e.g. ws://realtime-internal:8788 |
LINORA_DOCWORKER_URLS |
api | every doc worker’s URL, comma-separated (stable names: a StatefulSet or fixed hosts) |
LINORA_ALLOWED_ORIGINS |
api | https://app.example.com |
LINORA_COOKIE_INSECURE_ORIGINS |
api | empty. Only for plain-HTTP LAN origins of a local stack: their requests get non-Secure, unprefixed cookies (ADR 0905) |
LINORA_SIGNUP, LINORA_SIGNUP_ALLOWLIST |
api | invite + allowed addresses/domains (the default in production) |
LINORA_REALTIME_GATEWAYS / LINORA_REALTIME_OWNERS |
realtime | default 5 / 2 on Linux; size to the box (ADR 0020) |
LINORA_DOCWORKER_MAX_BYTES, LINORA_COMPACTOR_MAX_BYTES |
docworker, compactor | LRU/job caps; the RSS guard restarts at 1.5x + 256 MiB, so set the memory limit above that |
LINORA_URL, LINORA_MCP_HOST, LINORA_MCP_TRUST_PROXY |
mcp | internal API URL, 0.0.0.0, the number of proxies in front |
LINORA_WEB_CONNECT_SRC, LINORA_WEB_HSTS |
web | 'self' wss://app.example.com: always name the realtime origin from LINORA_REALTIME_URL in wss form, even on the same origin (not every browser covers ws(s) with ‘self’); HSTS on |
Full lists with defaults: .env.example and each module doc. Unknown variables are ignored, so check spelling against those.
.env* is gitignored). Images get only build-time CAs, as a BuildKit secret.kid:base64(32 random bytes)) and keep it offline. Derive the per-purpose keyrings with LINORA_TOKEN_KEYS=<master> node packages/server-common/src/token-keys.ts derive and give each tier only the ones it needs (table above). A doc worker therefore cannot mint user realtime tokens.
deploy/postgres/roles.sql with new passwords, then updating each tier’s secret. Old sessions keep working until they reconnect.npm run prod:env writes .env.prod (mode 600) with random values of all of the above. It never replaces the secrets of a stack that has data: --force refuses while the compose project has volumes, and otherwise backs up the old file first (ADR 0906).postgres:18-alpine). Managed services (RDS/Aurora, Cloud SQL, AlloyDB, Azure Flexible Server, Neon, Crunchy) work if they offer 18.citext; gen_random_uuid() is built in. Realtime uses LISTEN/NOTIFY (linora_auth, linora_file), so a transaction-pooling PgBouncer must not sit between realtime and the database. Session pooling or direct connections only.LINORA_API_DB_POOL (16) per replica; docworker LINORA_DOCWORKER_DB_POOL (4); compactor 2; migrate 1. Size max_connections, and optionally CONNECTION LIMIT per login.linora_api, linora_realtime, linora_docworker and linora_compactor. Before the first migration, run deploy/postgres/roles.sql as the owner or a superuser. It creates the groups if missing (so the migrator needs no CREATEROLE), one LOGIN user per tier (linora_api_login, …), and revokes CONNECT from PUBLIC. Example:
psql "$OWNER_URL" -v ON_ERROR_STOP=1 -v db=linora -v api_pw=... -v realtime_pw=... -v docworker_pw=... -v compactor_pw=... -f deploy/postgres/roles.sqlmigrate (owner URL) as a release step before rolling any tier. Migrations are additive (CONTRIBUTING), so old and new code run against the new schema during the rollout.?sslmode=verify-full in each URL), on a private network only.LINORA_S3_FORCE_PATH_STYLE=1) for stores without virtual-host DNS.LINORA_BLOB_STORE. Switching a running deployment from local to s3 means copying the existing objects into the bucket before flipping all four tiers together. The object key is the path relative to LINORA_BLOB_DIR, byte for byte (e.g. pages/<pageId>/<seq>.snap.gz and .struct.gz; page_snapshots.blob_key stores the same key), under LINORA_S3_PREFIX if set, so a straight copy of the directory works. Skip *.tmp-* files, which are leftovers of interrupted local writes. The bucket must exist beforehand; the app doesn’t create it.LINORA_S3_PREFIX, LINORA_S3_PART_SIZE (8 MiB), LINORA_S3_MULTIPART_THRESHOLD (16 MiB), LINORA_S3_SESSION_TOKEN (temporary credentials).Strict-Transport-Security (the web image sends it, and the API sends it in production); redirect HTTP to HTTPS; WSS only.LINORA_TRUSTED_PROXIES = the LB’s private range. Then the per-IP connection cap (LINORA_REALTIME_MAX_CONN_PER_IP, 2000) sees real clients.
LINORA_TRUSTED_PROXIES set to the LB (for per-IP rate limits). Don’t buffer responses (snapshots stream), keep body limits at least the API’s own, and preserve Host with its port (same-origin checks, ADR 0302).proxy_set_header inherits none from the server block, so set Host and X-Forwarded-For in every proxied location (ADR 0905)./assets/* and revalidation for index.html. A CDN in front is optional. Serve the app and the API on one origin, or add the API origin to LINORA_ALLOWED_ORIGINS and the realtime origin to LINORA_WEB_CONNECT_SRC.deploy/nginx/edge.conf is a reference L7 config (one realtime upstream, no TLS, outermost proxy).| Tier | Liveness | Readiness |
|---|---|---|
| api | GET :9465/healthz |
same, plus Postgres reachable (a failing DB shows as 5xx on /v1) |
| realtime | GET :8788/healthz |
same endpoint: it answers 503 while draining, so take the instance out of rotation on non-200 |
| docworker | GET :9466/healthz |
same (503 while draining) |
| compactor | GET :9467/healthz |
none (not routed) |
| mcp | GET :8789/healthz |
same |
| web | GET :8080/healthz |
same |
Suggested probes: period 10 s, timeout 2 s, failure threshold 3. Give realtime and the compactor a startup grace of 30 s.
LINORA_ARGON2_CONCURRENCY).tools/loadtest/. Gateway and owner thread counts follow cores. Raise ulimit -n (nofile) above the connection target.LINORA_DOCWORKER_URLS and roll the API. Rendezvous hashing moves only the pages of the changed worker. Memory limit = LINORA_DOCWORKER_MAX_BYTES x 1.5 + 256 MiB + headroom. Pages above a worker’s cap get 503 until a large-memory pool exists.pages.tail_ops/tail_bytes, compactor metrics) grows. A compactor never claims pages above (LINORA_COMPACTOR_MAX_BYTES - 128 MiB) / 400 B nodes, so run a large-memory one (bigger cap, LINORA_COMPACTOR_MIN_NODES below the regular ceiling) or those pages are never compacted and every open replays their whole tail (ADR 0706, 0311; compactor-large in docker-compose.prod.yml).migrate (and roles.sql on the first deploy)./healthz returns 503, so the LB stops routing to it);going_away with a random retry delay up to 60 s (DRAIN_SPREAD_MS), so reconnects spread out instead of stampeding;/healthz, and keep 60 s or more between instances so the previous wave has reconnected. Clients resubscribe with sinceSeq and lose nothing.PROTOCOL_VERSION or DOC_RULES_VERSION bump makes old clients reload (version_mismatch). For DOC_RULES_VERSION, compact every page with a non-empty tail before switching realtime (ADR 0019), and ship the web app in the same release.api_rate_buckets (global rate limits, ADR 0306) is an UNLOGGED table: it is not in WAL backups or replicas, and it starts empty after a crash or restore. That is by design, since limits refill.deploy/smoke.mjs <url> checks the restored stack end to end.LINORA_LOG_LEVEL, default info). Ship them with the platform’s collector./metrics): realtime per-thread counters and histograms, process RSS/heap/CPU everywhere. Scrape them on the private network./healthz flapping, commit backlog, busy/rate_limited rates, RSS near the memory limit (doc worker restarts with exit 75), compactor tail backlog, Postgres connections, replication lag, and backup failures.docker-compose.prod.yml runs everything above on one host: compiled images, per-tier DB logins and keys, an internal network, and an nginx edge on http://127.0.0.1:8080 (other devices too, in LAN mode). It has no TLS, so LINORA_WEB_HSTS is empty, and signup is open.
Deploys use committed code only. npm run prod:up (deploy/prod-up.mjs) exports a commit with git archive into a fresh temp dir, builds every image from that export, and runs docker compose -p <project> --env-file .env.prod up -d --build --wait --remove-orphans there. Uncommitted work in the tree, yours or another agent’s, never ships, and the script says how many changes it left out. The project name, .env.prod and the volumes stay the same, so data survives. Migrations run as the migrate one-shot, and only containers whose image or config changed are recreated (typically 15-30 s of disruption, realtime clients reconnect on their own). Images carry the label org.opencontainers.image.revision=<sha>. The edge config and roles.sql are baked into images (edge, db-roles targets), so the running stack never depends on the temp export.
The project is LINORA_PROD_PROJECT in .env.prod, which npm run prod:env writes (default linora-prod). prod:up reads it, and so do prod:ps, prod:logs, prod:down and any docker compose -f docker-compose.prod.yml --env-file .env.prod ..., through the compose file’s name:. Volumes, networks and images belong to the project: an install with data must keep its name, or it starts over with empty volumes.
| Task | Command |
|---|---|
| First time: secrets | npm run prod:env (writes .env.prod) |
| Build + start, or update to the latest commit | npm run prod:up (another commit: npm run prod:up -- --ref <ref>). It stops before building when another program holds the edge port, and prints the URL when the stack is healthy |
| Use another port than 8080 | set LINORA_PROD_PORT in .env.prod, then npm run prod:up |
| Behind a TLS-intercepting proxy | the proxy CA is read from LINORA_BUILD_CA, else NODE_EXTRA_CA_CERTS, e.g. LINORA_BUILD_CA=~/certs/proxy-root-ca.pem npm run prod:up (Troubleshooting) |
| Deployed revision | docker inspect -f '{{index .Config.Labels "org.opencontainers.image.revision"}}' linora-prod-api-1 (<project>-api-1) |
| Status | npm run prod:ps |
| Logs | npm run prod:logs [-- api realtime ...] |
| Restart one tier | docker compose -f docker-compose.prod.yml --env-file .env.prod restart <service> |
| Smoke test | node deploy/smoke.mjs http://127.0.0.1:8080 (any origin the stack serves, e.g. a LAN host) |
| LAN mode on / off | set / empty LINORA_PROD_LAN_HOSTS in .env.prod, then npm run prod:up (below) |
| Stop (keep data) | npm run prod:down |
| Start again after a stop | npm run prod:up. Without a stop, the stack restarts by itself whenever Docker starts (restart: unless-stopped) |
| Stop and delete data | npm run prod:down -- -v |
| Remove everything | npm run prod:down -- -v --rmi local (containers, networks, volumes and the images built for this project; shared base images such as postgres stay, docker image prune -a removes unused ones), then delete the clone |
| Throwaway copy (tests) | npm run prod:up -- --project <name> --env-file <file>, where the file sets its own LINORA_PROD_PROJECT=<name>, LINORA_PROD_PORT and LINORA_PROD_EDGE_SUBNET, so later compose commands with that file reach the copy, not your stack |
Data lives in the project’s pgdata, s3data and blobs volumes.
Before anyone else can reach it. The stack speaks plain HTTP and, by default, lets anyone who reaches it sign up.
LINORA_PROD_SIGNUP=invite and LINORA_PROD_SIGNUP_ALLOWLIST in .env.prod, then run npm run prod:up. The allowlist takes exact addresses and @domain suffixes, comma-separated (admin@example.org,@example.org). The first admin gets in by being on it: sign up with a listed address, then add the others to your projects. deploy/smoke.mjs signs up @example.com addresses, so list @example.com while you run it.npm run prod:env, never from .env.example values.Off by default: the edge is published on 127.0.0.1 only. To open the stack from another laptop or a phone on the same Wi-Fi (ADR 0905):
ipconfig getifaddr en0 (Wi-Fi IP, changes with DHCP) and echo "$(scutil --get LocalHostName).local" (Bonjour name; survives IP changes, but only while the Mac advertises it, which managed Macs may turn off)..env.prod: LINORA_PROD_LAN_HOSTS=192.168.1.20,my-mac.local (IPv4 addresses or names, comma-separated, no scheme or port).npm run prod:up (add LINORA_BUILD_CA=... behind a TLS-intercepting proxy). Only api, web and edge are recreated. prod-up prints the URLs. It warns when a listed IP is no longer this machine’s, or a listed name does not resolve to it.http://my-mac.local:8080 or http://192.168.1.20:8080, sign up or log in, and open a file.node deploy/smoke.mjs http://192.168.1.20:8080.What it changes:
0.0.0.0:<port> (every interface, so the .local name survives IP changes);LINORA_ALLOWED_ORIGINS and the web CSP connect-src (ws://host:port);LINORA_REALTIME_SAME_ORIGIN, always on in this compose);linora_session/linora_csrf without Secure (LINORA_COOKIE_INSECURE_ORIGINS). A plain-HTTP LAN origin is not a secure context, so browsers would drop the __Host- Secure cookies there. 127.0.0.1 and localhost keep __Host- + Secure.Firewall: with the macOS application firewall on, Docker Desktop’s com.docker.backend accepts the connections when “Automatically allow downloaded signed software” is enabled (the default). Otherwise macOS asks once whether it may accept incoming connections: answer Allow. “Block all incoming connections” must be off. A corporate VPN or zero-trust client may also block peer-to-peer LAN traffic.
Trade-off: this is plain HTTP. Anyone on the same network can read passwords, session cookies and documents in transit. While LAN mode is on, the edge listens on every network the machine joins, and signup is open. Turn it off on networks you don’t trust: empty LINORA_PROD_LAN_HOSTS, then npm run prod:up. If a session may have been exposed, revoke it in account settings (/v1/me/sessions). Docker Desktop shows every client to the edge as one address (192.168.65.1 with the 0.0.0.0 bind), so all devices share the per-IP limits (10 sign-ins, then 1 per 6 s).
When the IP changes: a .local URL keeps working if the Mac advertises its name. Otherwise, reserve the IP for this Mac in the router’s DHCP settings, or update LINORA_PROD_LAN_HOSTS and run npm run prod:up. A bare docker compose ... up without prod-up drops back to 127.0.0.1-only (the LAN variables are derived by deploy/lan.mjs).
The prod-like stack is developed and checked on macOS with Docker Desktop. On Linux and Windows the same commands apply, with these differences:
docker compose version must work; the old docker-compose v1 is not enough). Let your user run Docker without sudo (the docker group, then log in again, or rootless Docker): prod-up calls docker as you, and sudo npm ... usually can’t find a Node installed with nvm. Docker Engine has no memory setting of its own, so the machine itself needs the free memory.
hostname -I or ip -4 addr instead of ipconfig getifaddr en0; a .local name needs Avahi. Docker publishes ports through its own firewall rules, which bypass ufw, so in LAN mode the edge is reachable from the network whatever ufw says.~/linora, not /mnt/c/...). Builds are much faster there, .env.prod keeps its mode 600, and Git for Windows may convert line endings, which breaks the shell steps of the image build.memory= under [wsl2] in %UserProfile%\.wslconfig).| Symptom | Cause and fix |
|—|—|
| prod-up: port 8080 is already in use by another program, or Docker’s Bind for ...:8080 failed: port is already allocated | Another program, or another Linora stack, holds the port. Set LINORA_PROD_PORT=8081 in .env.prod, run npm run prod:up again, and use the new port in every URL (browser, smoke test, MCP). lsof -nP -iTCP:8080 -sTCP:LISTEN shows what holds it. |
| Cannot connect to the Docker daemon or failed to connect to the docker API ... check if the daemon is running | Docker isn’t running. Start Docker Desktop (macOS: open -a Docker) or the service (Linux: sudo systemctl start docker), wait until docker info answers, and run the command again. |
| prod-up: docker is not installed or not on PATH | Install Docker (see the Quickstart requirements). |
| Pool overlaps with other one on this address space | The edge network’s fixed subnet, 172.31.250.0/24, is taken by another Docker network (a second Linora stack, for example) or a VPN route. Set LINORA_PROD_EDGE_SUBNET in .env.prod to a free private /24, such as 172.31.251.0/24, and run npm run prod:up. |
| npm ci or the image build fails with SELF_SIGNED_CERT_IN_CHAIN, UNABLE_TO_GET_ISSUER_CERT_LOCALLY or unable to get local issuer certificate | A TLS-intercepting proxy (common on company networks and with some security software) re-signs HTTPS with its own root CA. Get that CA as a PEM file (your IT team has it), then export NODE_EXTRA_CA_CERTS=/path/to/proxy-root-ca.pem before npm ci and npm run prod:up. prod-up hands it to the image build as a BuildKit secret, never into an image; LINORA_BUILD_CA sets it for the build alone. If pulling base images fails with x509: certificate signed by unknown authority, Docker itself needs the CA: add it to the system’s trusted certificates and restart Docker. |
| The build stops with exit code: 137 or Killed, a tier keeps restarting in npm run prod:ps, or prod-up ends with is unhealthy or dependency failed to start | Usually too little memory for Docker. Give it at least 4 GB (Docker Desktop: Settings > Resources; WSL: .wslconfig) and run npm run prod:up again. docker inspect -f '{{.State.OOMKilled}}' <project>-<service>-1 confirms an out-of-memory kill; npm run prod:logs -- <service> shows the rest. Idle, the whole stack uses about 300 MB. The mem_limit values in docker-compose.prod.yml are caps, not reservations; only the large-page compactor can approach its 4 GB, while it compacts a very large page. |
| npm ci warns EBADENGINE with required: { node: '>=26.4.0' }, prod-up says Node ... is too old, or npm run prod:env prints nothing | Node is older than 26.4. Install a newer one (nvm install 26), check node --version, and start again from npm ci. |
| prod-up: git rev-parse ...: not a git repository | prod-up builds a committed revision, so it needs a git clone, not a downloaded source archive. |
| smoke: FAIL signup with 403 | Sign-up is invite-only: add @example.com to LINORA_PROD_SIGNUP_ALLOWLIST while you run the smoke test. |
| Another device can’t open the app | The stack listens on 127.0.0.1 only until you turn on LAN mode. |
Output that looks alarming but is fine:
db-roles, migrate and s3-init as Exited. They are one-shot jobs (database logins, migrations, the bucket), and prod-up fails if one of them fails.npm ci prints npm warn allow-scripts ... fsevents: npm asks you to approve the install script of fsevents, an optional macOS file watcher for the dev server. The Quickstart doesn’t need it.db log says initdb: warning: enabling "trust" authentication for local connections and no usable system locales were found. Trust applies only inside the database container; every tier logs in over the network with its own password.Reset a throwaway install. This deletes all of its data:
npm run prod:down -- -v # containers, networks and volumes
npm run prod:env -- --force # new secrets; the old .env.prod is backed up next to it
npm run prod:up
--force writes default settings, so copy LINORA_PROD_PORT, LINORA_PROD_LAN_HOSTS, LINORA_PROD_EDGE_SUBNET or the sign-up settings over from the backup before prod:up. To remove Linora completely, run npm run prod:down -- -v --rmi local and delete the clone.