Fleet & Fleet Cloud

Fleet & Fleet Cloud

Deploy one project to many servers with one command, over SSH or through the Fleet Cloud relay for servers you can't reach directly.

Before you start

  • A muster project that deploys on one machine.
  • SSH key access to each server (SSH transport), or an outbound internet connection on each server (cloud transport).
  • For cloud transport: a Fleet Cloud account and muster-tunnel on your machine (muster addon add fleet-cloud).

Choose a mode and a transport

Each server has a deploy mode and a transport, set when you add it.

ModeWhat happens on the server
mustermuster is installed there and runs muster deploy with its own muster.json: health checks, recovery and history on the server. Needs a paired token.
pushDefault. Your local hooks are piped over the connection and run with bash. Only bash is needed on the server.
TransportUse it when
sshDefault. The server is reachable over SSH with a key (BatchMode, 10 s connect timeout).
cloudThe server is behind NAT or a firewall. muster-agent on the server keeps an outbound connection to the relay; commands are end-to-end encrypted.

Set up a fleet over SSH

  1. 1

    Give muster a deploy key

    Terminal
    ssh-keygen -t ed25519 -f ~/.ssh/deploy-key -N "" -C "muster-fleet"
    ssh-copy-id -i ~/.ssh/deploy-key [email protected]
  2. 2

    Add servers and group them

    Terminal
    muster fleet init
    muster fleet add prod-1 [email protected] --key ~/.ssh/deploy-key --mode muster --path /opt/myapp
    muster fleet add prod-2 [email protected] --mode push
    muster fleet group web prod-1 prod-2
    muster fleet test web

    Adding a muster-mode server pairs it automatically (SSH test, muster check, deploy token). If that fails, create a token on the server with muster auth create fleet-main --scope deploy and run muster fleet pair prod-1 --token <token>.

  3. 3

    Deploy

    Terminal
    muster fleet deploy --dry-run   # preview
    muster fleet deploy web          # one group, one server at a time
    muster fleet deploy --parallel   # every server at once (max 10)

Set up a server on Fleet Cloud

Fleet Cloud is in beta. The protocol and APIs may change.
  1. 1

    Sign in on your machine

    Terminal
    muster cloud login    # device code in the browser; token goes to the keychain
    muster cloud status
  2. 2

    Connect the server

    Terminal
    # on the server
    muster cloud connect --name prod-east --project /opt/myapp
    cd /opt/myapp && muster hooks approve

    connect installs or updates muster-agent, shows a code and QR to approve in your account, and offers to install the agent as a service. Prefer a join token from the console? Run muster-agent join --token <token> --name prod-east --project /opt/myapp instead; the token works once.

  3. 3

    Add it to the fleet and deploy

    Terminal
    muster fleet add prod-east muster@prod-east --transport cloud --path /opt/myapp
    muster fleet test prod-east
    muster fleet deploy prod-east

Self-hosting the relay? Pass --relay https://relay.example.com to muster cloud login and muster cloud connect.

How fleet deploys run

Sequential (default) deploys one server at a time, in group order; on failure you can retry, skip or abort. Parallel runs up to 10 servers at once, then shows a summary with retry-failed and view-logs options. Rolling deploys one server, checks its health, then continues.

Push-mode servers need the hooks in place. --sync on a deploy, or muster fleet sync, copies hooks and project files to each server's project folder over SSH. A server added with --sync is synced before every deploy.

Terminal
muster fleet status                  # health across the fleet
muster fleet logs prod-1 api --tail 100
muster fleet restart prod-1 api --yes
muster fleet rollback web

Fleet, group or remote?

FeatureScope
FleetOne project to many servers.
GroupMany projects deployed together, in order.
Remote deployOne service's hooks on one host, from muster.json.

They don't conflict; one project can use all three.

Security

Over SSH, everything travels inside the SSH connection and credentials are exported on the server, never passed as arguments. Agent reports are encrypted with a per-fleet RSA-4096 key (AES-256 session keys). Hook payloads can be signed (payload signing).

Over the relay (agent and tunnel 0.5.0 and later), each command uses a fresh hybrid key exchange (X25519 + ML-KEM-768 through HKDF-SHA256), then ChaCha20-Poly1305 with per-direction keys and an authenticated header. The relay routes frames but can't read, replay, reorder or alter them. Older agents use the v1 protocol.

Reference

Config files

~/.muster/fleets/
~/.muster/fleets/<fleet>/
├── fleet.json
├── skills.json
├── fleet.key, fleet.pub        report encryption keys
└── <group>/<server>/project.json
project.json
{
  "host": "10.0.1.10",
  "user": "deploy",
  "port": 22,
  "identity_file": "~/.ssh/prod-key",
  "project_dir": "/opt/myapp",
  "mode": "muster",
  "transport": "ssh"
}

A legacy remotes.json (in the project or ~/.muster/) is still read.

Relay wire format

WebSocket binary frames with an 89-byte header and a payload. Full specification: muster-fleet-cloud.

Frame header
Offset  Size  Type        Field
0       1     uint8       Version (0x01)
1       1     uint8       MsgType
2       4     uint32 BE   PayloadLength
6       16    [16]byte    RequestID
22      32    [32]byte    SourceID
54      32    [32]byte    DestID
86      1     uint8       Flags
87      2     [2]byte     Reserved
89      N     []byte      Payload
MessagePurpose
AUTH_REQUEST (0x01)Client authenticates with the relay.
AUTH_RESPONSE (0x02)Relay accepts or rejects.
AGENT_HELLO (0x03)Agent announces capabilities and public key.
HEARTBEAT (0x05)Keep-alive (30 s interval, 90 s timeout).
COMMAND (0x10)Run an action on the agent.
COMMAND_RESULT (0x12)Final result with exit code.
STREAM_DATA (0x20)Streaming stdout and stderr.
KEY_EXCHANGE (0x30)CLI identity key plus fresh X25519 and ML-KEM-768 keys.
KEY_EXCHANGE_ACK (0x31)Agent identity, pinned ML-KEM key, fresh X25519 key, ML-KEM ciphertext.
ErrorMeaning
E_AUTHAuthentication failed.
E_NOT_CONNECTEDTarget agent isn't connected to the relay.
E_COMMAND_REJECTEDCommand not in the agent's allowlist.
E_TIMEOUTOperation timed out.
E_DECRYPTPayload decryption failed.
E_AGENT_BUSYAgent is already running a command.