Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Cockpit

Cockpit is Mir’s web interface — a browser-based view of the platform with no separate deployment required.

Grafana device explore


Dashboards

Fully customizable widget grid — drag, resize, and arrange tiles freely. The home page shows a pre-configured welcome dashboard; more can be created from the Dashboards section.

LayoutDrag-and-drop widgets, read-only / edit mode toggle
RefreshAuto-refresh with configurable interval
PersistenceLayouts saved across sessions

Device Fleet

Live table of all registered devices. Click any device to open its detail view across five tabs:

TabDescription
OverviewDigital twin — namespace, ID, labels, desired vs. reported properties
TelemetryInteractive charts with field selector, time presets (1 min → 90 days), brush zoom, split views, data table, and Grafana link
CommandsSend commands with a syntax-highlighted JSON editor, dry-run validation, and a per-status response panel (SUCCESS ERROR VALIDATED PENDING)
ConfigurationEdit config schemas, compare reported vs. desired values, dry-run before applying
EventsDevice-scoped log of all interactions and state changes

Events

System-wide log of all platform activity — connections, commands, config changes, schema uploads. Supports pagination (up to 500 per page), time-range filtering, and UTC / local time toggle.

Interface

Context SwitcherSwitch between Mir deployments from the header — one Cockpit can reach multiple servers
Themes7 built-in themes: Dawn, Rust, Mocha, Dusk, Aurora, Midnight, Hacker
VIM ModeVIM keybindings for JSON payload editors — pass a small proficiency test to unlock (hint: :q)
Time DisplayToggle UTC / local time for all timestamps via the clock icon
Docs DrawerIn-app documentation covering Cockpit, CLI, and SDK development

🚀 Operating Cockpit

Accessing Cockpit

Have a Mir deployment ready:

Once mir is running, open your browser at the configured port:

http://localhost:3015

Cockpit is a single-page application built with Svelte.

🔌 How It Connects

Cockpit does not connect to NATS directly over TCP — it uses a WebSocket connection defined by webTarget in your CLI contexts config (~/.config/mir/cli.yaml). This allows the browser to reach the NATS message bus through a standard WebSocket port.

contexts:
  - name: local
    target: nats://localhost:4222      # used by the CLI
    webTarget: ws://localhost:9222     # used by Cockpit (browser)
    grafana: localhost:3000
KeyDescription
targetNATS TCP URL — used by the CLI and the Mir server itself
webTargetWebSocket URL — used by the Cockpit browser client
grafanaGrafana base URL — powers “Open in Grafana” links on the telemetry page

If webTarget is not set, Cockpit falls back to target on port 9222.

Port 9222 is the NATS WebSocket listener — it is configured on the NATS server side, not by Cockpit itself.

⚙️ Configuration

Cockpit is configured in two files.

Server Config

Controls the HTTP server and Cockpit service behaviour:

mir:
  http:
    port: 3015          # port Cockpit is served on
    tlsCert: ""         # path to TLS certificate (enables HTTPS)
    tlsKey: ""          # path to TLS private key
  cockpit:
    enabled: true
    allowedOrigins: []  # CORS allowed origins (empty = allow all)
    githubOwner: MaxThom
    githubRepo: mir

Contexts Config

Defines the servers Cockpit exposes to the browser:

logLevel: info
currentContext: local
contexts:
  - name: local
    target: nats://localhost:4222
    webTarget: ws://localhost:9222
    grafana: localhost:3000

In Docker, these map to the two mounted config files:

  • ./mir-compose/mir/local-config.yaml → server config
  • ./mir-compose/mir/local-contexts.yaml → contexts config

See Docker Authentication for the full setup flow with authentication.

See Server-Only TLS for HTTPS and WSS setup.