Skip to main content
Use Docker when you want the Agent Canvas distribution and its backend services to run in a container rather than directly on your host. The official image packages the Canvas client, Agent Server, Automation Server, and ingress in one container. Agent Server and its tools can access only the project directories and other resources you expose to the container.

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 available at http://localhost:8000/canvas. The backend base URL remains http://localhost:8000, and the agent can access any project under the mounted /projects path.

Environment Variables

Configuration is passed via -e flags on docker run: You can also pass --disable-telemetry to the Agent Canvas runtime. Use the environment variable for deployment configuration because older images ignore an unknown environment variable but reject an unknown runtime flag. Product telemetry is separate from the SDK tracing variables above, which send traces only to a backend you configure.
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.

Let the Agent Use Docker

By default the agent cannot run containers: docker is installed in the image, but the daemon cannot start inside an unprivileged container. If the agent tries, it fails with error creating default "bridge" network: operation not permitted. That matters for tasks where a container is part of the workflow — building a Dockerfile and running it to confirm the change works, bringing up a docker compose stack to reproduce a bug, or using a toolchain that is only published as an image. Without a daemon the agent can edit those files but cannot verify them. To enable it, start the container with --privileged:
--privileged gives the container broad access to the host kernel, which substantially weakens the isolation between the agent and your machine. The agent can execute arbitrary shell commands, so grant this only on a host you are willing to expose and only when the agent genuinely needs to run containers.
Verify from inside the container:
There is no safer middle ground. The Docker daemon needs kernel capabilities that are granted by the host when the container starts, so they cannot be acquired later — and rootless Docker does not avoid this: the daemon starts, but containers it creates fail to launch (error mounting "proc" to rootfs: operation not permitted).OpenHands Enterprise solves this differently, running each sandbox under a hardened runtime that provides kernel-level isolation so nested containers run unprivileged. See Running Docker in the Agent Sandbox.

Enable SDK Tracing

The container runs the OpenHands Agent Server, which uses the OpenHands SDK. The SDK emits traces automatically when Laminar or OpenTelemetry environment variables are set, so pass them to docker run to trace Agent Canvas conversations. For the full variable reference, see Observability & Tracing.

Laminar example

OTLP collector example

If your collector runs on the host, localhost inside the container refers to the container itself. Use host.docker.internal; on Linux, also add the host gateway alias as shown:
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.
Exporters do not backfill earlier conversations. Configure tracing before starting the conversations you want to observe.

What the Image Provides

The image includes SDK trace instrumentation and export. It does not include a trace backend: Laminar, Jaeger, Grafana Tempo, Datadog, Honeycomb, and New Relic are services you run or subscribe to separately. It also does not expose a Prometheus /metrics endpoint. The SDK exporter sends traces, not scrape metrics. To view traces in Grafana, export them to Grafana Tempo or another trace backend and add that backend as a Grafana data source. The SDK’s token, cost, and latency tracking is a separate feature for SDK integrations; see Metrics Tracking.

Inspect Conversations Through the Backend API

The backend API is separate from tracing and uses the same LOCAL_BACKEND_API_KEY as the UI. You can use it to inspect conversations stored in the Docker backend, including one that does not appear in the left panel.
After you find a conversation ID, list its most recent events:

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 Backends → Add Backend.
  2. Fill in:
    • Name — e.g. docker-backend
    • Host / Base URL — http://localhost:8000
    • API Key — the LOCAL_BACKEND_API_KEY value, or the generated key in ~/.openhands/agent-canvas/api-key.txt
  3. Save and select it as the active backend.