dimo-server is a headless composition root over the exact same Rust HostRuntime (ApplicationCore, SQLite dual-pool persistence, Dedicated-Engine-first AgentRuntime with ACP fallback per ADR-0087, Pulse event automation engine in crates/pulse, Delegation & Collaboration Space, Plugin Kernel v4, Artifact service, and Automation scheduler) used by desktop Dimo (dimo). It runs without loading the Electron shell.
See ADR-0054, docs/architecture.md, and docs/protocol/v1/README.md for the Host-family and wire-protocol contracts.
The Server distribution ships a unified Host-family directory containing dimo-server, sibling dimo-mcp, production web/ (frontend/dist), and dimo-plugin.json. Assemble locally with:
node scripts/package-host-family.js \
--server target/release/dimo-server \
--mcp target/release/dimo-mcp \
--web frontend/dist \
--plugins plugins \
--output dist/host-familynpx dimoai, install.sh, and install.ps1 download Dimo-${VERSION}-{linux-x86_64,linux-aarch64,darwin-aarch64,windows-x86_64,windows-aarch64}-server.tar.gz from the matching GitHub Release, verify both the outer .sha256 sidecar and inner SHA256SUMS, and launch dimo-server with DIMO_STATIC_ROOT pointed at web/ (asset names derive from npx-cli/bin/release-assets.js).
npx dimoai serve # Bind 0.0.0.0:17891, list origins, print long-lived host token
npx dimoai serve --local # Bind 127.0.0.1:17891 (loopback-only WebUI)
npx dimoai serve --rotate-token # Issue a new host token and invalidate old admin tokenserve(aliasweb) persists the long-lived admin token in<DIMO_DATA_DIR>/host.token(0600on Unix) so subsequentserveruns print the same token, while SQLite stores only its SHA-256 digest.- Plain
npx dimoaianddocker compose up -dbind127.0.0.1:17891by default. Public internet exposure requires an external TLS reverse proxy (Caddy, Traefik, Nginx, or Tailscale Serve).
Install native Coding Agent CLIs and ACP compatibility adapters into the Host machine's user environment without starting the HTTP server:
npx dimoai list
npx dimoai list --refresh
npx dimoai install claude_code --yeslist groups Dimo's 20 Built-in Agents (routed to Dedicated Agent Engines when available, with ACP fallback per ADR-0087) above ACP Official Registry entries. install installs npm / uv / binary distributions into the user environment and records the verified InstallationLock used by subsequent serve sessions (npx dimoai agent list queries an already-running Host instead).
| Variable | Default | Policy |
|---|---|---|
DIMO_DATA_DIR |
Platform Dimo data directory | Only one Desktop or dimo-server owner may run against a data directory at a time. |
DIMO_SERVER_LISTEN |
127.0.0.1:17891 |
Non-loopback bind requires DIMO_SERVER_ALLOW_LAN=1 (set automatically by dimo serve). |
DIMO_SERVER_ALLOW_LAN |
Unset | Enable only behind a trusted LAN or external TLS/auth boundary. |
DIMO_SERVER_TOKEN |
Generated once | Optional override: ≥ 32 bytes with ≥ 12 distinct byte values. Supply via secret manager/env, never URL query strings. |
DIMO_STATIC_ROOT |
Unset | Path to production frontend/dist (web/). |
DIMO_SERVER_ALLOWED_ORIGINS |
Empty | Comma-separated exact browser origins for CORS (wildcards and reflected origins are rejected; same-origin needs no entry). |
- Credentials: HTTP requests pass
Authorization: Bearer <token>; WebSocket/api/v1/wsnegotiatesSec-WebSocket-Protocol: dimo.token.<base64url>. Query-string tokens are unconditionally rejected. - Pulse Webhook & Event Endpoints (
/api/pulse/*): Alongside Remote Protocol v1 (/api/v1/*),dimo-servermounts the Pulse event bus (crates/pulse) under/api/pulse/*for inbound webhook ingestion, event emission, timer scheduling, and rule evaluation over the same SQLite dual-pool store and Host security boundaries. - Artifact & Preview Proxies: Preview URLs carry a short-lived, capability-scoped lease pinned to a registered loopback upstream port and never forward host credentials.
- Scope:
dimo-servertargets single-owner workstation/team-box deployments (Server ownerinCONTEXT.md); it does not implement multi-tenant user isolation, Kubernetes HA clustering, or built-in ACME public TLS termination.
pnpm run server:package-smokeBuilds production frontend/dist and release dimo-server, boots against an isolated temporary data directory on loopback, validates authenticated/unauthenticated /api/v1/capabilities, and verifies zero token leakage in stdout/stderr logs.
- Quiesce: Stop every Desktop (
dimo) anddimo-serverprocess usingDIMO_DATA_DIR. - Consistent Backup: Snapshot
db.sqlite,db.sqlite-wal,db.sqlite-shm,host.token, managed tool locks, and Artifact files together before replacing binaries. - Replace & Verify: For automated upgrades,
server::apply_host_upgradeverifiesSHA256SUMS, snapshots the data directory, and swapsdimo-server,dimo-mcp, andweb/. - Post-Start Check: Boot a single Host, check
/healthand authenticated/api/v1/capabilities, and verify Automation startup reconciliation before connecting remote clients. - Rollback: Stop the upgraded binary, restore the pre-upgrade data-directory snapshot alongside the previous Host-family release archive, and restart. Never run an older binary against a post-migration SQLite file without restoring the matching snapshot.
401 Unauthorizedon HTTP or WebSocket close: Confirm the token is sent inAuthorization: Bearer <token>(orSec-WebSocket-Protocol: dimo.token.<base64url>), never?token=.... Check whetherserve --rotate-tokenrotated the admin token or whether the Paired Device was revoked in the Host Console.- Pairing Invitation Rejected or Expired: Pairing secrets are single-redeem and expire after 30 minutes by default (configurable via
--ttl, bounded up to 30 days). Already-paired devices merge updatedReachabilityorigins from a fresh invitation without re-redeeming the secret; unpaired devices need a freshly issued invitation if the secret was already consumed or expired. - Immediate Revocation: Revoking a Paired Device invalidates both new HTTP calls and open
/api/v1/wsstreams immediately.
- Durable Reconnect (
after_sequence):/api/v1/wsfollowsready → snapshot/replay → live. Clients reconnect with their highest persistedsequence; if the gap exceeds the in-memory ring, the Host sends a freshsnapshotbefore resumingliveevents. 1 MiBFrame Cap: Oversized client frames are rejected by the WebSocket transport. Keep command payloads concise and attach large files via workspace paths or artifact uploads.- Offline Cache: When the Host is unreachable, Companion and Workstation clients surface cached timelines strictly as
read_only: trueand never queue blind offline mutations. See Companion & Paired Remote Clients.
- Single-Owner Engine Lease:
dimo-serverruns a dedicated read/write SQLite dual-pool overdb.sqlite(WAL mode) with a single-owner Host lease. Only one Host process may hold a data directory at a time; if Automation or Pulse runs appear paused, check whether another Desktop ordimo-serverinstance still holds the directory. - Orphaned Runs Marked
Interrupted: If the Host crashes or restarts mid-turn, startup recovery marks orphaned direct-Turn runsinterruptedand reconciles in-progress Workflow runs without re-triggering side-effecting prompts. At most one missed schedule window is caught up after downtime.
- Runtime Lock Failures (e.g.,
dimo.office/dimo.browser/dimo.session-enhance): Plugins declaringdepends/runtimes/*.jsonrequire HTTPS downloads matching their pinnedsha256and a passing bounded--versionprobe before their Activation Generation can publish. Behind corporate proxies or offline hosts, pre-populate or verify outbound GitHub Release access and inspect/plugins/<id>diagnostics. - Preview Stopped Responding:
ArtifactPreviewLeaseinstances (such asofficecli watch) shut down automatically afteridleTimeoutMinutesor when the last preview tab closes; reopening the file acquires a fresh lease. - Redacted Diagnostics: Host logs and diagnostic bundles scrub bearer tokens, pairing secrets, and Model Provider API keys by design.