Skip to Content
DocsDeploymentSelf-hosted relay

Self-hosted relay

You can self-host Cmdop’s relay because it is already inside the cmdop binary you installed. Pick one host, run cmdop server create to choose how the relay should be reachable, start it, then join your other machines to it with its fleet join key. There is no database, no cache, and no second service to provision.

Cmdop’s relay is built into the cmdop binary. One host creates and runs it; your other machines join it. There is nothing else to provision.

1. Choose how it should be reachable

Decide this first — it is the one choice that is awkward to change later.

ModeReachAddress
lanSame host or a trusted LANHTTP :63141, gRPC :63142
publicThe internet, through Cmdop’s managed reverse tunnel<subdomain>.cmdop.dev
own_domainYour own FQDN, with ACME TLSThe domain you configure

LAN is plaintext by design. Keep it on loopback, a private network, or a trusted tunnel — do not expose the LAN listeners directly to the internet. Public and own-domain modes give you the internet-facing TLS door.

If you want to attach to a machine remotely later, you need public or own_domain. LAN-only machines are not remotely attachable.

2. Create and start the relay

Interactive:

cmdop server create cmdop server --detach cmdop server status

Non-interactive LAN setup:

cmdop server create --mode lan --no-prompt cmdop server --detach

Public mode needs a subdomain:

cmdop server create --mode public --subdomain my-box --no-prompt cmdop server --detach

cmdop server create refuses to overwrite an existing configuration unless you pass --force.

3. Get the join key

The fleet join key is what machines present when they join. Read or rotate it from Server → Security in the web console, which also prepares the complete cmdop join command ready to paste. Or from the terminal:

cmdop server join-key

Treat it as a secret — every joining agent uses it.

4. Join your machines

On the machine you want to add, for a LAN relay:

cmdop join <join-key> \ --server http://192.168.1.50:63141 \ --insecure

For a public or own-domain relay:

cmdop join <join-key> --server https://my-box.cmdop.dev

Joining saves a per-server credential in the OS keyring, makes that server the active one, and starts the agent.

Billing and relay operation are separate surfaces. If the account console shows a quota warning, resolve it there; use relay health and machine status to diagnose whether a machine can actually connect. See Usage and quotas.

5. Point machines at more than one relay

cmdop remotes manages the relays this machine connects to. It is a different thing from cmdop server, which runs this machine’s own relay.

cmdop remotes add 192.168.1.50 cmdop remotes add https://relay.example.com cmdop remotes list cmdop remotes use <slug>

remotes add probes the relay’s health endpoint before saving; use --no-check to stage one that is temporarily offline. Adding an entry does not join the machine to that relay — run cmdop join afterward. remotes use switches the active server and asks a running agent to reconnect.

Credentials are per relay. After switching, join that relay again if authentication fails.

Storage for chat attachments

The relay caps its attachment store at 2 GiB by default. To change the budget, add this to server.yaml and restart the relay:

attachments: quota_bytes: 4294967296

Cmdop clears never-sent staging after 24 hours and removes orphans from deleted conversations. It never evicts a file that chat history still references — when safe reclamation is not enough, new uploads report storage full instead.

One-shot overrides

For CI or a single command:

CMDOP_SERVER_URL=https://relay.example.com \ CMDOP_GRPC_URL=relay.example.com:443 \ cmdop status

These override the persisted active server for that process only. CMDOP_SERVER_URL includes a scheme; CMDOP_GRPC_URL is host:port.

Administering the relay from a browser

Open the relay’s HTTP or public URL. A browser on the same host is recovered through the loopback policy; a LAN or public caller enters the relay admin password or uses a one-time sign-in link. If you lose that password:

cmdop server admin-password --reset

See The web console for what you can do once you are in.

Common questions

How do I self-host Cmdop?

Install the cmdop binary on one host, run cmdop server create, start the relay, read its fleet join key, and join machines to that relay. The relay is inside the binary; there is no separate database, cache, or service stack to provision.

Which relay mode should I choose?

Use lan for loopback or trusted private networks, public for an internet-facing Cmdop-managed subdomain, and own_domain when the relay should answer on your own FQDN with TLS. Choose this before relying on remote terminal attach.

Does self-hosting remove Cmdop-operated services?

No. Self-hosting puts the relay and fleet credentials under your control. Account, plan, marketplace, and managed public-edge surfaces remain separate Cmdop-operated services when you use them.

Last updated on