Skip to content

Production Deployment

A production cluster is merod nodes, each in an Intel TDX VM booted from a signed mero-tee image: three or more for redundancy, or one that grows (below). Calimero runs shared clusters and dedicated ones (Calimero Cloud); the steps here are the same for either. Nodes run on Linux only. This page is what you decide and configure; the flags are in the merod reference and the file in Configuration.

callerspeople (browsers)passkeys on --rp-id;pages on --origins or{label}.--apps-domainservicesSDKs, meroctl, proxywith an API keyoperator (mdma)ops token (/ops/*)operator key (signs)backup key (offline)HTTPSfrontTLS, DNS:a name pernode, *.appssees sealedbytes onlyno bufferingfor SSE;64 MiB bodiescluster (--cluster eu1)TD n1TD n2TD n3merod runmerod runmerod run--bootstrapsystem votersystem votersystem voterapp replicasapp replicasapp replicas:2528:2528:2528peers: sealed /internal/*, Raft, cluster secretjob nodes (optional)merod run --job-node --cluster-identity HEXcompute only: no store, no vote, no K_cevery node: data dir sealed under K_c,K_c wrapped under K_r (cluster-key)what nodes reachmero-kms--kms-url: K_r after quotepackage registry--registry-urlsigned mero-tee releases+ Intel DCAP collateral--backup-direvery 60 s, sealed under K_ccopy off the machine--recovery-direvery 5 min, sealed toeach holder's backup keymetrics scraper (private network)plain GET /metrics on --metrics-listenOnly /health, /attestation and the consent page travel in the clear; every other request is sealed to the attested node.Each node's --public-url must reach that node itself: peers send Raft traffic there.
Piece What it is
Nodes merod run in TDX mode (no --dev), one per TD. Each serves the node API on --listen and is reached at its --public-url.
mero-kms Releases each node’s storage key after verifying its quote against the signed release policy.
Package registry Where nodes fetch signed .mpk releases (--registry-url). Optional if every release is uploaded.
Job nodes Optional: merod run --job-node --cluster-identity HEX, TDs that only run compute (pipelines) for the cluster’s apps; no store, vote or cluster key. Registered with meroctl ops add-node ID URL --role job.
Backup storage A directory (--backup-dir) that receives sealed snapshots of the apps and the system group, opened only with the cluster key.
Recovery disk A second disk (--recovery-dir) that receives backups sealed to each app’s holder’s backup key, which outlive every mero-kms (Backups and the recovery disk).
Operator keys Kept off the nodes: the ops token (only its hash on the nodes), the operator’s Ed25519 key (--operator-key takes its public half) and, where the operator upgrades apps, its X25519 backup key.
TLS front Whatever terminates HTTPS for browsers in front of each node.
DNS A name per node, and a wildcard name for --apps-domain if you serve app frontends.

The image provides MERO_TEE_VERSION (the mero-tee release it is) and MERO_TEE_PROFILE (its profile). A TDX node refuses to start without them, because its attestation names them and it judges its peers by them.

Each node takes a storage key K_r = HKDF-SHA256(KMS key, salt calimero.cloud.storage.v1, info = --cluster), and seals everything on disk under the cluster key K_c, which it keeps wrapped under K_r (The cluster key). In TDX mode the KMS key comes from mero-kms only:

Terminal window
merod --node n1 init ... --kms-url https://kms.internal.example.com/ \
--kms-identity /data/disk-identity --cluster eu1
  • mero-kms is trusted only if its own quote matches the signed release the environment names (MERO_KMS_RELEASE_TAG, else MERO_KMS_VERSION, else MERO_TEE_VERSION); the key is sealed to this TD.
  • The KMS derives one key per identity. All nodes of a cluster must present the same disk identity file and the same --cluster, so they derive the same K_r. The founding node takes its K_r as K_c; the others, and later every node of a new release (whose mero-kms gives another K_r), take K_c from a peer. merod creates the identity file if it is missing; create it once and give every node a copy.
  • --storage-key and --storage-key-file are refused without --dev: a key the host could hand the node would let whoever runs the host read the disks.

merod kms disk-key is the same client as a command, for a boot script that needs a disk-unlock key before merod starts; it writes the key to tmpfs or ramfs only.

  1. Give every founding node the same cluster settings: the same --cluster, KMS identity, --peers list (every founding node, as id=url), --rp-id, --origins and governance flags, and a unique --node-id and --public-url.

    Terminal window
    merod --node n1 init --node-id 1 --public-url https://n1.eu1.example.com/ \
    --cluster eu1 \
    --peers 1=https://n1.eu1.example.com/,2=https://n2.eu1.example.com/,3=https://n3.eu1.example.com/ \
    --kms-url https://kms.internal.example.com/ --kms-identity /data/disk-identity \
    --rp-id example.com --origins https://app.example.com \
    --ops-token-sha256 "$OPS_TOKEN_SHA256" --operator-key "$OPERATOR_PUBLIC_HEX" \
    --backup-dir /backups --recovery-dir /recovery \
    --registry-url https://registry.example.com/

    The operator key is an Ed25519 key pair the operator keeps; the node takes only its 32-byte public half in hex. Every operator decision (registering a node, a replica move, quotas, a restore, the operator’s backup key) is refused without its signature, and the key is recorded at genesis, so choose it before the first start.

  2. Bootstrap on one node. Add --bootstrap to exactly one founding node’s first start. It forms the system group with --peers as voters; the others wait to be contacted. A restart with --bootstrap still set does nothing.

  3. Start them all with merod --node nX run. The first leader writes the genesis (the governance below and the operator key) and registers the --peers in the fleet directory. Nobody can sign up before genesis.

  4. Check it formed:

    Terminal window
    meroctl --api https://n1.eu1.example.com/ --tee-profiles "$PROFILE" network status
    meroctl --api https://n1.eu1.example.com/ --tee-profiles "$PROFILE" \
    --ops-token "$OPS_TOKEN" ops status

    ops status shows the system group’s voters and leader and the fleet.

Nodes added later are not in --peers: see Add a node.

1 · one noden1system voterapp Aapp Bapp C--bootstrap withone peer; apps getmin(--replicas, nodes)replicas: one eachno redundancy2 · add nodesn1voterABCn2learner→ votern3learner→ voterPOST /ops/nodes {id, addr, zone}→ the system leader adds eachas a learner; once two havecaught up, both become voterssystem voters 1 → 3 (never 2)3 · rebalancen1voterABCn2voterABCn3voterABCmdma's rebalancer readsGET /ops/placement, then onePOST /ops/apps/{app}/replicasat a time (bundle + blobs first)apps survive a node loss4 · drainnX drainingreplicas moved offfirst, thenDELETE /ops/nodes/{id}(system leader)refused while an appkeeps a replica there;a removed voter isreplaced by a caught-uplearnermerod never moves an app by itself: placement picks a new app's replicas, moves come through the Ops API.The system group grows to 3 voters by itself (zones no voter is in first) and no further; later nodes stay learners.Learners still serve: every node answers clients and forwards writes to the leaders.

A cluster may be bootstrapped on one node (--peers naming only itself) and grown. While it is one node, every app gets one replica and that node is a single point of failure. Each node registered later (POST /ops/nodes, with its zone) joins the system group as a learner; once two learners have caught up, the system leader makes them voters in one change, so the system group goes from one voter to three, never two, and never past three by itself. Apps placed while the cluster was small are spread by replica moves: mdma’s rebalancer reads GET /ops/placement and sends one POST /ops/apps/{app}/replicas at a time, and the app’s leader hands the new replicas the app’s bundle and blobs before they join. To retire a node, move its replicas away first; DELETE /ops/nodes/{id} is refused while an app keeps a replica there. The steps are in the runbooks: Grow from one node, Remove a node.

Three decisions are each given, when the cluster is formed, to either each app’s owner (the default: the app’s organization, whose members holding the right capability approve with a passkey) or the operator (for every app, signed with the operator key):

Flag The decision
--release-approvals Which mero-tee releases may hold apps’ data (cluster upgrades).
--app-upgrades Which bundle an app runs, and so who holds each app’s backup key on the recovery disk.
--outbound-approvals Which URL prefixes apps may call out to.

Three more rules are set the same way:

Flag Default The rule
--deployments open|granted open Who may install packages: any account, or only accounts and organizations holding a deployer grant. The operator may later move open to granted (POST /ops/deployments/granted), never back.
--deployers operator|owner operator Who grants deployers and runs sign-up: the operator’s key, or the cluster’s owner once the operator names it (POST /ops/cluster-owner).
--sign-up open|invite|closed open Who may create an account (Sign-up policy); changed later only by a signed POST /ops/sign-up (or the owner’s POST /sign-up).

They are fixed at genesis, attested with every node’s receipt key, and reported to users (meroctl attest app), so a user can check them before trusting the cluster. Give the operator a decision only where users trust it with code, or destinations, that can read their data. See Security.

A node can write two kinds of backup, and a production cluster wants both:

a nodeholding apps andthe system groupwrites both, ifboth flags are set--backup-dir: the cluster's own keyevery 60 s, leaders{app}/….snap + .manifestsystem/, code/cluster-key/{release}sealed under K_copens where K_c opensa node of this cluster, or afounder whose K_r (from a livemero-kms of a kept release)unwraps cluster-key/{release}come backone app:ops restore APPwhole cluster: merod run--bootstrap --restore-from--recovery-dir: the holder's backup keyevery 5 min, any holderoperator/ or org-<id>/(the holder's directory)app-*, system/holder,code-*, file segmentsHPKE to the holder'sX25519 key; signed bythe attested receipt keyopens with the backup keyon the holder's own machine:check signature + attestation,open each file's data key,send only that data keyno node, no mero-kmsever holds the private halfoperatormerod run --bootstrap --recover-from DIRops recover; then per appops restore --recovery-key-fileorganizationPOST /recover/holder fromits device; operator admits--backup-dir is lost with the last mero-kms of every release that kept a copy of K_c;--recovery-dir outlives every mero-kms, under a new cluster key.The holder is whoever upgrades the app: the operator (--app-upgrades operator), else its organization;nothing is written for a holder that set no backup key.
  • --backup-dir DIR: every 60 seconds, a snapshot of each group the node leads, sealed under the cluster key K_c, beside K_c wrapped under this release’s storage key and the code the system state names. Only a node that holds K_c (this cluster’s, or a founder whose mero-kms still opens a kept copy) reads it. It restores one app (meroctl ops restore APP) or founds the cluster again (merod run --bootstrap --restore-from DIR). Copy it off the machine.
  • --recovery-dir DIR: every 5 minutes, on every node that holds an app (leader or not), the app’s state, its sealed files’ segments and its code, and each holder’s slice of the system state, each sealed (HPKE) to the X25519 public key of whoever upgrades the app and signed by the node’s attested receipt key. It opens with that key alone, so it survives the loss of every mero-kms. On Calimero Cloud the image mounts the disk mdma attaches as recovery here.

Nothing is written to the recovery disk for a holder that set no backup key; the node warns apps whose holder set no backup key are not on the recovery disk on each pass. Where the operator upgrades apps (--app-upgrades operator), set the operator’s key once the cluster is formed (needs every node on 1.0.0-rc.20 or later, else 409 FEATURE_NOT_ACTIVE):

Terminal window
# on a machine that is not a node; keep operator-backup.key offline
meroctl ops recovery-keygen --out operator-backup.key
# prints { "publicKey": "<64 hex>", "secretKeyFile": "operator-backup.key" }
meroctl --ops-token "$OPS_TOKEN" --operator-key-file operator.key \
ops backup-key --public-key <publicKey>
meroctl --ops-token "$OPS_TOKEN" ops backup-key # check: { holder, key, apps }

Where owners upgrade apps, each organization’s MANAGE_APPLICATION holders set its key with a passkey (POST /orgs/{org}/backup-key; a person’s own apps are in an organization like any other). Recovery itself is in the runbooks: Restore an app, Found a cluster again, Recover after every key service is gone.

The repository’s Dockerfile builds an image whose entrypoint is merod, with CALIMERO_HOME=/data and /data a volume. Every key can be an environment variable, so a container needs no init:

Terminal window
docker run -d --name n1 -p 2528:2528 -v n1-data:/data \
-e MEROD_NODE_ID=1 -e MEROD_PUBLIC_URL=https://n1.eu1.example.com/ \
-e MEROD_DATA_DIR=/data/n1 -e MEROD_CLUSTER=eu1 \
-e MEROD_PEERS=1=https://n1.eu1.example.com/,2=https://n2.eu1.example.com/,3=https://n3.eu1.example.com/ \
-e MEROD_KMS_URL=https://kms.internal.example.com/ -e MEROD_KMS_IDENTITY=/data/disk-identity \
-e MEROD_OPS_TOKEN_SHA256="$OPS_TOKEN_SHA256" -e MEROD_OPERATOR_KEY="$OPERATOR_PUBLIC_HEX" \
-e MERO_TEE_VERSION="$RELEASE" -e MERO_TEE_PROFILE="$PROFILE" \
merod run

merod here is the image tag (docker build -t merod .); the arguments after it go to the merod binary.

The image EXPOSEs 2528, the default --listen port.

merod serves plain HTTP. What it serves is already sealed end to end to the attested node, so a TLS terminator in front of it sees only sealed bytes, plus /health and /attestation, which are public. You still need HTTPS in front:

  • Passkeys work only in a secure context, and a page on https:// cannot call an http:// API. Serve each node’s --public-url over HTTPS.
  • --public-url must be the URL clients and peers actually use, and it must reach that node, not any node: peers send Raft traffic to it, and the system directory records it.
  • One name may balance across nodes: a passkey ceremony or a confirmation begun on one node can finish on another, which takes the challenge from the node that issued it (internal/challenge/take).
  • /apps/{app}/events and /apps/{app}/presence/stream are server-sent event streams; turn off response buffering for them. Each node serves at most 4096 open streams.
  • Requests up to 64 MiB must pass (bundle and package uploads).

With --apps-domain apps.example.com and a wildcard DNS name *.apps.example.com pointing at the cluster, each installed package’s frontend is served from its signed release at {label}.apps.example.com and at this cluster’s {cluster_label}.apps.example.com, and each deployment’s at its own {dlabel}.apps.example.com. TLS for the wildcard name is the front’s job; a front shared by several clusters routes each cluster label to its cluster. Keep --cluster stable: the cluster labels derive from it. A custom domain a package’s manager registered as a served origin also needs its own DNS record to the front and a certificate for its name; GET /ops/served-origins lists them. See Networking.

The consent page, where people approve what an app’s frontend asks, can link to an independent attestation verifier so they check the node’s TDX attestation on a site the node does not control: --attestation-verifier-url https://verify.calimero.network (Calimero’s), or your own deployment of one (merod).

  • No node runs with --dev, --storage-key, --storage-key-file or --allow-unsigned-bundles.
  • MERO_TEE_VERSION and MERO_TEE_PROFILE come from the image; --peer-profiles lists only the profiles you run.
  • Every node has the same --cluster, disk identity, --rp-id, --origins and governance flags.
  • Exactly one founding node had --bootstrap on its first start.
  • The ops token is configured as --ops-token-sha256, and the token itself is kept outside the machines.
  • --backup-dir is set and its contents leave the machine.
  • --recovery-dir is a disk of its own, and the holder of every app’s backups (the operator, or each organization) has set a backup key whose private half is kept off the nodes.
  • --operator-key was set on the founding nodes, and the operator’s Ed25519 key is kept outside the machines.
  • --rp-id is the domain users sign in on; --origins lists the HTTPS origins of your frontends.
  • Quotas are set for your cluster (meroctl ops set-quotas).
  • Something collects /ops/metrics from every node through the sealed channel; see Observability.