Skip to main content
The official Docker image packages the full Agent Canvas stack — backend and frontend — in a single container. The agent runs inside the container rather than directly on your host, giving you a sandboxed environment out of the box.

Prerequisites

  • Docker installed and running (Docker Desktop on macOS/Windows, or Docker Engine on Linux)
  • Agent Canvas installed locally (if connecting from another instance) — see Setup

Run the Official Image

Mount a persistence directory for settings, secrets, and conversation history, and a projects directory for workspace access.
Agent Canvas is now running at http://localhost:8000. The agent can access any project under the mounted /projects path.

Environment Variables

Configuration is passed via -e flags on docker run: For the full tracing reference, see Observability & Tracing.
The agent server can execute arbitrary shell commands inside the container. If exposing it beyond localhost, set LOCAL_BACKEND_API_KEY to a strong secret.

View Backend Conversations and Events

Agent Canvas includes a backend API for conversations and events. This is built in and uses the same LOCAL_BACKEND_API_KEY that the UI uses. It is separate from observability tracing. Use this API if you need to inspect conversations stored in the Docker backend, including a conversation that is not visible in the left panel.
After you find a conversation ID, inspect recent events:
Observability exporters do not backfill old conversations. Set up tracing before starting the conversations you want to observe.

Built-in Tracing vs. External Backends

Built into Agent Canvas Docker:
  • The OpenHands Agent Server runs inside the container and uses the OpenHands SDK.
  • The SDK automatically emits traces when Laminar or OTEL environment variables are present.
  • The backend conversation and event APIs are available behind LOCAL_BACKEND_API_KEY.
Not built into Agent Canvas Docker:
  • A Prometheus /metrics endpoint for scraping agent execution metrics.
  • A Grafana connector that authenticates into Agent Canvas or makes conversations appear in the left panel.
  • Hosted Laminar, Jaeger, Tempo, Prometheus, Grafana, Datadog, Honeycomb, or New Relic services. Those are external observability systems you run or subscribe to separately.
The SDK also has built-in token, cost, and latency tracking for SDK-based integrations; see Metrics Tracking. That is different from service metrics scraped by Prometheus. For Grafana, the typical tracing setup is to export OTLP traces from Agent Canvas to Grafana Tempo or another trace backend, then add that backend as a Grafana data source. Prometheus is useful for metrics, but the SDK tracing exporter sends traces, not Prometheus scrape metrics.

Enable SDK Tracing

The Docker image starts the OpenHands Agent Server inside the container, and the Agent Server uses the OpenHands SDK. To enable tracing for Agent Canvas conversations, pass Laminar or OpenTelemetry environment variables to docker run.

Laminar example

OTLP collector example

If your collector runs on your host machine, remember that localhost inside the container means the Agent Canvas container itself. Use host.docker.internal on Docker Desktop, or add the host gateway alias on Linux.
If the collector runs in another container, put both containers on the same Docker network and use the collector’s container or Compose service name in the endpoint, for example http://jaeger:4317.

Connect from the Frontend

Start the frontend separately and point it at the container:
Then add the Docker backend:
  1. Click the backend switcher → Manage BackendsAdd Backend.
  2. Fill in:
    • Name — e.g. docker-backend
    • Host / Base URLhttp://localhost:8000
    • API Key — the LOCAL_BACKEND_API_KEY value (check container logs if auto-generated)
  3. Save and select it as the active backend.