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.
The shape of a deployment
Section titled “The shape of a deployment”| 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.
Storage key
Section titled “Storage key”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:
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, elseMERO_KMS_VERSION, elseMERO_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.merodcreates the identity file if it is missing; create it once and give every node a copy. --storage-keyand--storage-key-fileare 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.
Form the cluster
Section titled “Form the cluster”-
Give every founding node the same cluster settings: the same
--cluster, KMS identity,--peerslist (every founding node, asid=url),--rp-id,--originsand governance flags, and a unique--node-idand--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.
-
Bootstrap on one node. Add
--bootstrapto exactly one founding node’s first start. It forms the system group with--peersas voters; the others wait to be contacted. A restart with--bootstrapstill set does nothing. -
Start them all with
merod --node nX run. The first leader writes the genesis (the governance below and the operator key) and registers the--peersin the fleet directory. Nobody can sign up before genesis. -
Check it formed:
Terminal window meroctl --api https://n1.eu1.example.com/ --tee-profiles "$PROFILE" network statusmeroctl --api https://n1.eu1.example.com/ --tee-profiles "$PROFILE" \--ops-token "$OPS_TOKEN" ops statusops statusshows the system group’s voters and leader and the fleet.
Nodes added later are not in --peers: see
Add a node.
Growing a cluster
Section titled “Growing a cluster”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.
Governance
Section titled “Governance”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.
Backups and the recovery disk
Section titled “Backups and the recovery disk”A node can write two kinds of backup, and a production cluster wants both:
--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 asrecoveryhere.
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):
# on a machine that is not a node; keep operator-backup.key offlinemeroctl 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.
Run it in a container
Section titled “Run it in a container”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:
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 runmerod 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.
TLS and load balancers
Section titled “TLS and load balancers”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 anhttp://API. Serve each node’s--public-urlover HTTPS. --public-urlmust 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}/eventsand/apps/{app}/presence/streamare 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).
App frontends
Section titled “App frontends”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).
Checklist
Section titled “Checklist”- No node runs with
--dev,--storage-key,--storage-key-fileor--allow-unsigned-bundles. -
MERO_TEE_VERSIONandMERO_TEE_PROFILEcome from the image;--peer-profileslists only the profiles you run. - Every node has the same
--cluster, disk identity,--rp-id,--originsand governance flags. - Exactly one founding node had
--bootstrapon its first start. - The ops token is configured as
--ops-token-sha256, and the token itself is kept outside the machines. -
--backup-diris set and its contents leave the machine. -
--recovery-diris 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-keywas set on the founding nodes, and the operator’s Ed25519 key is kept outside the machines. -
--rp-idis the domain users sign in on;--originslists the HTTPS origins of your frontends. - Quotas are set for your cluster (
meroctl ops set-quotas). - Something collects
/ops/metricsfrom every node through the sealed channel; see Observability.