如何安装(1/2)

End-to-end installation of OpenHands Enterprise on Kubernetes using Helm

OpenHands Enterprise is distributed as a Helm chart through the Replicated registry. Your license credentials authenticate the chart download, and the chart embeds your license automatically at install time.

Helm-based installation requires an OpenHands Enterprise license. If you don't have one yet, register for a free 30-day trial or contact our team to get set up. The license YAML from the install portal is all the licensing material you need: use spec.customerEmail as the registry username and spec.licenseID as its password. The embedded-cluster installer assets on that portal are for VM installations, not Helm.

Prerequisites

  • A Kubernetes cluster with a default storage class and an ingress controller (see Resource Limits for sizing guidance)
  • Helm v4 or later
  • kubectl access to the target cluster
  • Your license ID and the email address registered with your license (both provided by our team)
  • LLM credentials from your chosen provider, for example an Anthropic API key from the Anthropic Console
  • DNS records you control, following the layout used throughout this guide (with openhands.example.com as the base domain): app.openhands.example.com (application), auth.openhands.example.com (login), runtime-api.openhands.example.com, and <id>-runtime.openhands.example.com for the per-session sandboxes. Every hostname sits one label under the base domain, so a single wildcard record *.openhands.example.com pointing at your cluster's ingress covers all of them; see DNS and TLS.
  • A wildcard TLS certificate for *.openhands.example.com, which you provide.
  • An authentication method for user login — GitLab, Bitbucket Data Center, and more are supported; this guide uses a GitHub App. See Creating a GitHub App.

Step 1: Log in to the registry

Authenticate Helm against the Replicated registry using your license. Supply the license ID on standard input so it does not appear in the command history:

read -r -s -p "License ID: " OH_LICENSE_ID; echo
printf '%s' "$OH_LICENSE_ID" | helm registry login registry.replicated.com \
  --username <your-license-email> \
  --password-stdin
unset OH_LICENSE_ID

Step 2: Create the namespaces and secrets

We recommend running agent sandboxes in a namespace separate from the application. Sandboxes run agent-authored code, so a dedicated namespace keeps them isolated from the application, database, and secrets. Create both namespaces now:

kubectl create namespace openhands
kubectl create namespace openhands-runtimes

The chart references several Kubernetes secrets that you create ahead of installation, all in the openhands namespace:

kubectl -n openhands create secret generic jwt-secret \
  --from-literal=jwt-secret=<random-string>

kubectl -n openhands create secret generic keycloak-admin \
  --from-literal=admin-password=<random-string>

kubectl -n openhands create secret generic keycloak-realm \
  --from-literal=realm-name=allhands \
  --from-literal=server-url=http://keycloak \
  --from-literal=client-id=allhands \
  --from-literal=client-secret=<random-string> \
  --from-literal=smtp-password=<smtp-password>

OH_POSTGRES_PASSWORD="$(openssl rand -hex 32)"
kubectl -n openhands create secret generic postgres-password \
  --from-literal=username=postgres \
  --from-literal=password="$OH_POSTGRES_PASSWORD" \
  --from-literal=postgres-password="$OH_POSTGRES_PASSWORD"
unset OH_POSTGRES_PASSWORD

kubectl -n openhands create secret generic redis \
  --from-literal=redis-password=<random-string>

kubectl -n openhands create secret generic lite-llm-api-key \
  --from-literal=lite-llm-api-key=<random-string>

kubectl -n openhands create secret generic admin-password \
  --from-literal=admin-password=<random-string>

kubectl -n openhands create secret generic litellm-env-secrets \
  --from-literal=ANTHROPIC_API_KEY=<your-llm-api-key>

The application and Runtime API must use the same key. Create both Secrets from one generated value:

OH_RUNTIME_SHARED_KEY="$(openssl rand -hex 32)"
kubectl -n openhands create secret generic default-api-key \
  --from-literal=default-api-key="$OH_RUNTIME_SHARED_KEY"
kubectl -n openhands create secret generic sandbox-api-key \
  --from-literal=sandbox-api-key="$OH_RUNTIME_SHARED_KEY"
unset OH_RUNTIME_SHARED_KEY

Then create the secret for user authentication. Other providers (GitLab, Bitbucket Data Center, and more) are supported, but this guide uses GitHub throughout. If you don't have a GitHub App yet, run our script — its output provides every value below, and the private key file is written to its keys directory:

kubectl -n openhands create secret generic github-app \
  --from-literal=app-id=<github-app-id> \
  --from-literal=app-slug=<github-app-slug> \
  --from-literal=client-id=<github-app-client-id> \
  --from-literal=client-secret=<github-app-client-secret> \
  --from-literal=private-key="$(cat <github-app-private-key>.pem)" \
  --from-literal=webhook-secret=<github-app-webhook-secret>

Generate strong random values (for example with openssl rand -hex 32) for each remaining <random-string> placeholder, and store them in your secret manager. Use one value for both Runtime API Secrets. Since this example connects to PostgreSQL as postgres, use one value for its password and postgres-password fields too. To use an existing PostgreSQL instance instead of the bundled one, see External PostgreSQL.

Step 3: Configure values

Create a values.yaml with your environment-specific configuration. The minimum for a working installation covers application ingress and TLS, user authentication, the runtime (sandbox) endpoints, conversation storage, and your LLM provider. PostgreSQL and Redis run embedded in the cluster; the bundled PostgreSQL needs a database name and database creation turned on, both shown below (to use your own database instead, see External PostgreSQL).

The embedded PostgreSQL is intended for proof-of-concept and evaluation use only, not production. For production deployments we recommend bringing your own managed PostgreSQL — see External PostgreSQL. There is no officially supported migration path from the embedded PostgreSQL instance to an external one, so plan to switch to an external database before you load production data.

The example below uses Traefik, the chart's default ingress class; set ingress.class and the annotations to match your controller.

ingress:
  enabled: true
  host: app.openhands.example.com
  class: traefik

  # This guide brings its own certificate, terminated at the ingress controller,
  # so the chart's per-ingress TLS is disabled (see the note below the example).
  tls:
    enabled: false

# Enables login via the GitHub App created in Step 2
github:
  enabled: true

# Bundled PostgreSQL: name the application database and let the chart create
# the databases it needs on first start
postgresql:
  auth:
    database: openhands
  primary:
    persistence:
      enabled: true
      storageClass: <your-storage-class>
databaseMigrations:
  createDatabases: true

# Login is served by the bundled Keycloak — both the component and its
# ingress must be enabled for users to be able to log in
keycloak:
  enabled: true
  ingress:
    enabled: true
    hostname: auth.openhands.example.com
    tls: false

# Where agent sandboxes run. The runtime API needs its own hostname, and each
# sandbox gets its own hostname under your wildcard DNS record.
sandbox:
  apiHostname: https://runtime-api.openhands.example.com

env:
  RUNTIME_URL_PATTERN: "https://{runtime_id}-runtime.openhands.example.com"
  LITELLM_DEFAULT_MODEL: litellm_proxy/claude-sonnet-4-5

runtime-api:
  # Create sandboxes in the dedicated namespace from Step 2, isolated from the
  # application workloads.
  sandbox_namespace: openhands-runtimes
  ingress:
    enabled: true
    host: runtime-api.openhands.example.com
    tls: false
  databaseMigrations:
    createDatabases: true
  env:
    # Sandbox hostnames are built as {runtime_id}<separator><RUNTIME_BASE_URL>;
    # together these must match RUNTIME_URL_PATTERN above. RUNTIME_DISABLE_SSL
    # defaults to "true"; it must be "false" so sandbox URLs are served over https.
    RUNTIME_BASE_URL: runtime.openhands.example.com
    RUNTIME_URL_SEPARATOR: "-"
    RUNTIME_DISABLE_SSL: "false"
    # Storage class for sandbox volumes. The chart default (standard-rwo) only
    # exists on GKE — set a storage class from `kubectl get storageclass` or
    # sandboxes will never start.
    STORAGE_CLASS: <your-storage-class>

# On EKS, provide S3 access using the IAM role or Secret in the EKS guide.
# Replace the bucket and region with your values.
filestore:
  ephemeral: false
  type: s3
  bucket: <your-bucket>
  region: <your-region>
minio:
  enabled: false

litellm-helm:
  enabled: true
  proxy_config:
    model_list:
      - model_name: claude-sonnet-4-5
        litellm_params:
          model: anthropic/claude-sonnet-4-5
          api_key: os.environ/ANTHROPIC_API_KEY

This example uses Amazon S3 for conversation storage. Follow the EKS object storage steps to grant the application access to the bucket. On another Kubernetes provider, configure a supported external object store and its credentials before installing.

Chart 0.71.1 redirects signed-in users to /canvas but does not enable that frontend by default. For this chart version, add the following to values.yaml so the first conversation can start:

agent-canvas:
  enabled: true
  ingress:
    enabled: true
    host: app.openhands.example.com
    className: traefik
    path: /canvas
    tls:
      enabled: false
  staticServer:
    authRequired: false
    lockToCloud: https://app.openhands.example.com

The static frontend can load without a second API-key prompt; Enterprise API requests still use the signed-in session. Later chart versions may provide a working default UI without these overrides.

Step 4: Install

helm install openhands oci://registry.replicated.com/openhands/openhands \
  --namespace openhands \
  --values values.yaml

Watch the workloads come up:

kubectl get pods -n openhands --watch

The first install pulls all container images, which can take a while. Along with the application components you'll see a replicated pod — the Replicated SDK, which handles license verification and powers the support tooling below.

Step 5: Validate the installation

The chart ships preflight checks that validate your cluster against the application's requirements. Run them with the preflight CLI:

preflight secret/openhands/openhands-preflight

The preflight and support-bundle CLIs are both part of Troubleshoot. Install them with:

curl -L https://krew.sh/preflight | bash
curl -L https://krew.sh/support-bundle | bash

Then confirm the application is reachable at your configured hostname and log in. A complete first-use check goes beyond Ready pods and preflight:

  1. Open https://app.openhands.example.com and sign in through your configured identity provider. The conversation UI should load without an additional backend URL or API-key prompt.
  2. Start a new conversation and ask the agent to run pwd. Confirm a sandbox starts in openhands-runtimes, the command returns a path, and the agent gives a completed reply.
  3. If the conversation cannot start, use the first-conversation checks before changing the deployment.

On chart 0.71.1, a fresh user's selected Default LLM profile may not match LITELLM_DEFAULT_MODEL. If the first request reports an invalid proxy token or model, inspect the selected profile and the bundled LiteLLM model list using the troubleshooting checks. Do not enter an infrastructure API key into the browser to work around this error.

Next Steps

The install above is a minimal working baseline. Features and tuning are values overrides on the same release — edit your values.yaml and apply with helm upgrade using the chart URL from Step 4:

Size memory, CPU, and replicas for production workloads.



Use your own PostgreSQL instead of the embedded instance.



Enable conversation analytics with Laminar.



Run scheduled or event-triggered tasks on a Helm installation.



Offer curated plugins to your users.

Troubleshooting

For a guided diagnostic workflow and a map of OHE components, see Troubleshooting.

Generate a support bundle

If something isn't working, generate a support bundle with the support-bundle CLI. It discovers the diagnostic specs that ship with the chart and collects logs, resource states, and health checks from the installation:

kubectl support-bundle --load-cluster-specs --namespace openhands

Send it to us

Upload the resulting archive directly to our support team — the upload authenticates with the license embedded in the bundle:

kubectl support-bundle upload support-bundle-<timestamp>.tar.gz

Common issues

Symptom Likely cause
helm install fails with a template error mentioning replicated Helm version too old — upgrade to v4+
helm registry login or chart pull returns 401/403 License credentials incorrect, or the license isn't enabled for Helm installs — contact support
Preflight warns about node memory Cluster nodes below the recommended sizing — see Resource Limits

Install Agent Canvas on a VM as a backend-only service or full self-hosted Canvas.

Run Agent Canvas on a VM or dedicated machine when you want an always-on backend, more compute, or a self-hosted Canvas that you can reach from other devices.

The agent server can read and write the host filesystem, execute shell commands, access the network, and store secrets. Treat the VM as trusted infrastructure. Use --public, a strong LOCAL_BACKEND_API_KEY, and a network access control layer before exposing it to the internet.

Choose a Deployment Shape

Agent Canvas supports two VM runtime modes and several ways to reach them:

Setup Start Command How You Use It
Backend only agent-canvas --backend-only --public Run only the agent server on the VM. Start agent-canvas --frontend-only on your laptop and add the VM URL in Manage Backends.
Backend only + ngrok agent-canvas --backend-only --public and ngrok http 8000 Use your ngrok domain as the backend URL. Do not add ngrok OAuth for this mode; rely on LOCAL_BACKEND_API_KEY.
Full Canvas agent-canvas --public Serve both the Agent Canvas UI and the backend from the VM. Open the VM, reverse proxy, or ngrok URL in a browser.
Full Canvas + ngrok OAuth agent-canvas --public and ngrok http 8000 --traffic-policy-file ~/policy.yml Protect the full Canvas URL with an ngrok login policy before users reach Agent Canvas.

Use backend only when you want to keep the UI on your laptop and switch between backends. Use full Canvas when the VM should serve the browser UI too.

1. Provision and Secure the VM

Use any always-on Linux or macOS host. Ubuntu 24.04 LTS with 2 vCPU and 4 GB RAM is enough for a single user.

Before starting Agent Canvas, restrict inbound traffic:

  • SSH (22) — allow only your IP address or VPN CIDR.
  • Agent Canvas (8000) — keep closed unless you are using an SSH tunnel. If you expose it through ngrok, nginx, or another proxy, expose only that proxy.
  • HTTP/HTTPS (80, 443) — open only if you configure a reverse proxy and TLS.

2. Install Prerequisites

Agent Canvas requires:

  • Node.js 24 or later, including npm.
  • uv for the agent server runtime.
  • git and curl.
  • Optional: ngrok for a public URL on a free ngrok domain or your own custom domain.
  • Optional: tmux to keep Agent Canvas and ngrok running after disconnecting from SSH.

Ubuntu 22.04 / 24.04

Install Node.js 24.x, uv, and Agent Canvas:

sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg git

# Node.js 24.x from NodeSource.
curl -fsSL https://deb.nodesource.com/setup_24.x | sudo -E bash -
sudo apt-get install -y nodejs

# uv for the agent server runtime.
curl -LsSf https://astral.sh/uv/install.sh | sh
source "$HOME/.local/bin/env"

# Agent Canvas CLI.
sudo npm install -g @openhands/agent-canvas

node --version
uv --version
agent-canvas --version

If your npm global prefix is user-writable, omit sudo from npm install -g. For macOS or other Linux distributions, use the official Node.js, uv, and ngrok installation links above instead of the Ubuntu-specific commands.

Install optional runtime helpers if needed:

sudo apt-get install -y tmux

Install ngrok only if you plan to expose the VM through ngrok:

curl -sSL https://ngrok-agent.s3.amazonaws.com/ngrok.asc \
  | sudo tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null

echo "deb https://ngrok-agent.s3.amazonaws.com buster main" \
  | sudo tee /etc/apt/sources.list.d/ngrok.list

sudo apt-get update
sudo apt-get install -y ngrok

ngrok config add-authtoken <YOUR_NGROK_AUTHTOKEN>

Get the authtoken from the ngrok dashboard.

3. Set the Backend API Key

Remote and shared deployments should always run in public mode. Public mode requires LOCAL_BACKEND_API_KEY.

Create a local environment file on the VM:

cat > ~/.agent-canvas.env <<'EOF_ENV'
export LOCAL_BACKEND_API_KEY="<choose-a-strong-secret>"
EOF_ENV
chmod 600 ~/.agent-canvas.env
source ~/.agent-canvas.env

Use a high-entropy secret. You will enter this key in Agent Canvas when connecting to the VM backend or opening the full Canvas UI.

4. Start Agent Canvas

Start only the backend on the VM:
source ~/.agent-canvas.env
agent-canvas --backend-only --public
Then start the frontend on your laptop:
agent-canvas --frontend-only
Add the VM backend in Agent Canvas:

1. Click the backend switcher, then select `Manage Backends`.
2. Click `Add Backend`.
3. Enter a name, such as `my-vm`.
4. Enter the **Host / Base URL**:
   * `http://localhost:8000` if you use an SSH tunnel.
   * Your ngrok domain (for example `https://your-domain.ngrok-free.app`) if you use ngrok.
   * Your reverse proxy URL if you use nginx or another proxy.
5. Enter the `LOCAL_BACKEND_API_KEY` from the VM.
6. Save and select the backend.



Start the full UI and backend on the VM:
source ~/.agent-canvas.env
agent-canvas --public
Open the VM, reverse proxy, or ngrok URL in a browser. Agent Canvas prompts for the `LOCAL_BACKEND_API_KEY` before allowing backend access.

Keep It Running with tmux

Use tmux when you want Agent Canvas to keep running after your SSH session disconnects.

tmux new-session -d -s canvas
tmux send-keys -t canvas 'source ~/.agent-canvas.env && agent-canvas --backend-only --public' Enter
tmux attach-session -t canvas
tmux new-session -d -s canvas
tmux send-keys -t canvas 'source ~/.agent-canvas.env && agent-canvas --public' Enter
tmux attach-session -t canvas

Detach from tmux with Ctrl-b, then d. Reattach later with tmux attach-session -t canvas.

5. Choose an Access Method

Option A: SSH Tunnel

Use an SSH tunnel when you only need personal access and do not want to expose a public URL.

On your laptop:

ssh -L 8000:127.0.0.1:8000 user@your-vm

Then use http://localhost:8000 as the backend URL in Manage Backends.

Option B: ngrok Without OAuth

Use ngrok without OAuth for personal access or a small, trusted backend. Keep --public enabled and use a strong LOCAL_BACKEND_API_KEY.

Every ngrok account—including the free plan—comes with a free static domain that looks like your-domain.ngrok-free.app. It stays the same across restarts, so ngrok http 8000 starts on it by default and you can save the URL once and keep reusing it. You can view your domain on the Domains page of the ngrok dashboard.

On the VM, in a second terminal or tmux pane:

ngrok http 8000

Use the forwarding URL:

  • Backend-only mode: enter it as the Host / Base URL in Manage Backends.
  • Full Canvas mode: open it directly in your browser.

Use Your Own Domain

To run on a domain you choose instead of the default, pass it with --url:

ngrok http 8000 --url https://your-canvas.ngrok.app

What you can use depends on your ngrok plan:

  • Hobbyist plan: an ngrok-branded domain such as your-canvas.ngrok.app.
  • Pay-as-you-go plan: your own custom domain such as canvas.acme.com.

Option C: ngrok With Google OAuth

Use ngrok OAuth with full Canvas deployments when the ngrok URL may be reachable by a team or a broader audience. OAuth is an additional gate in front of Agent Canvas; it does not replace LOCAL_BACKEND_API_KEY.

For backend-only deployments, use ngrok without OAuth and keep --public enabled. OAuth is best suited to the full Canvas URL where the UI and backend share the same origin.

Create ~/policy.yml, replacing openhands.dev with your allowed Google Workspace domain:

on_http_request:
  # Require Google OAuth login.
  - actions:
      - type: oauth
        config:
          provider: google

  # Deny anyone outside the allowed domain.
  - expressions:
      - "!actions.ngrok.oauth.identity.email.endsWith('@openhands.dev')"
    actions:
      - type: deny
        config:
          status_code: 403

Start ngrok with the traffic policy:

ngrok http 8000 --traffic-policy-file ~/policy.yml

To run OAuth on a domain you choose, add --url as shown in Use Your Own Domain.

To run full Canvas and ngrok side by side in tmux:

tmux new-session -d -s canvas
tmux send-keys -t canvas 'source ~/.agent-canvas.env && agent-canvas --public' Enter
tmux split-window -h -t canvas
tmux send-keys -t canvas 'ngrok http 8000 --traffic-policy-file ~/policy.yml' Enter
tmux attach-session -t canvas

Option D: Reverse Proxy With TLS

Use a reverse proxy when you need a stable domain instead of an ngrok URL. Point a domain at the VM, proxy it to 127.0.0.1:8000, and terminate TLS at the proxy.

On Ubuntu, install nginx and Certbot:

sudo apt-get install -y nginx certbot python3-certbot-nginx

Create /etc/nginx/sites-available/canvas.example.com, replacing canvas.example.com with your domain:

server {
    listen 80;
    listen [::]:80;
    server_name canvas.example.com;

    location /.well-known/acme-challenge/ {
        root /var/www/html;
    }

    location / {
        proxy_pass http://127.0.0.1:8000;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

        # WebSocket / SSE support for live agent events.
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_read_timeout 3600s;
        proxy_send_timeout 3600s;
    }
}

Enable the site and issue a certificate:

sudo ln -sf /etc/nginx/sites-available/canvas.example.com \
  /etc/nginx/sites-enabled/canvas.example.com
sudo nginx -t
sudo systemctl reload nginx

sudo certbot --nginx -d canvas.example.com \
  --non-interactive --agree-tos \
  --email you@example.com \
  --redirect

Use https://canvas.example.com as the URL for either the remote backend entry or the full Canvas UI.

Security Checklist

Before exposing Agent Canvas beyond an SSH tunnel:

  1. Run with --public and set a strong LOCAL_BACKEND_API_KEY.
  2. Restrict network access with a firewall, VPN, ngrok OAuth, or an identity-aware proxy.
  3. Use HTTPS for any internet-reachable URL.
  4. Limit who can SSH to the VM and keep the OS patched.
  5. Protect the VM filesystem because it stores settings, secrets, conversations, and working copies.
  6. Rotate keys if an ngrok URL, API key, or VM login is shared too broadly.

Getting started with running OpenHands on your own.

System Requirements

A system with a modern processor and a minimum of 4GB RAM is recommended to run OpenHands.

Prerequisites

<AccordionGroup>

**Docker Desktop**

1. [Install Docker Desktop on Mac](https://docs.docker.com/desktop/setup/install/mac-install).
2. Open Docker Desktop, go to `Settings > Advanced` and ensure `Allow the default Docker socket to be used` is enabled.




  Tested with Ubuntu 22.04.


**Docker Desktop**

1. [Install Docker Desktop on Linux](https://docs.docker.com/desktop/setup/install/linux/).




  Looking for a video guide? Check out this [step-by-step Windows setup tutorial](https://youtu.be/Kp40Qqz4ZPw).


**WSL**

1. [Install WSL](https://learn.microsoft.com/en-us/windows/wsl/install).
2. Run `wsl --version` in PowerShell and confirm `Default Version: 2`.

**Ubuntu (Linux Distribution)**

1. Install Ubuntu: `wsl --install -d Ubuntu` in PowerShell as Administrator.
2. Restart computer when prompted.
3. Open Ubuntu from Start menu to complete setup.
4. Verify installation: `wsl --list` should show Ubuntu.

**Docker Desktop**

1. [Install Docker Desktop on Windows](https://docs.docker.com/desktop/setup/install/windows-install).
2. Open Docker Desktop, go to `Settings` and confirm the following:

* General: `Use the WSL 2 based engine` is enabled.
* Resources > WSL Integration: `Enable integration with my default WSL distro` is enabled.


  The docker command below to start the app must be run inside the WSL terminal. Use `wsl -d Ubuntu` in PowerShell or search "Ubuntu" in the Start menu to access the Ubuntu terminal.

</AccordionGroup>

Start the App

We recommend using uv for the best OpenHands experience. uv provides better isolation from your current project's virtual environment and is required for OpenHands' default MCP servers (like the fetch MCP server).

Install uv (if you haven't already):

See the uv installation guide for the latest installation instructions for your platform.

Install OpenHands:

uv tool install openhands --python 3.12

Launch OpenHands:

# Launch the GUI server
openhands serve

# Or with GPU support (requires nvidia-docker)
openhands serve --gpu

# Or with current directory mounted
openhands serve --mount-cwd

This will automatically handle Docker requirements checking, image pulling, and launching the GUI server. The --gpu flag enables GPU support via nvidia-docker, and --mount-cwd mounts your current directory into the container.

Upgrade OpenHands:

uv tool upgrade openhands --python 3.12

If you prefer to use pip and have Python 3.12+ installed:

# Install OpenHands
pip install openhands

# Launch the GUI server
openhands serve

Note that you'll still need uv installed for the default MCP servers to work properly.

Option 2: Using Docker Directly

docker run -it --rm --pull=always \
  -e AGENT_SERVER_IMAGE_REPOSITORY=ghcr.io/openhands/agent-server \
  -e AGENT_SERVER_IMAGE_TAG=1.26.0-python \
  -e LOG_ALL_EVENTS=true \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v ~/.openhands:/.openhands \
  -p 3000:3000 \
  --add-host host.docker.internal:host-gateway \
  --name openhands-app \
    docker.openhands.dev/openhands/openhands:1.8

You'll find OpenHands running at http://localhost:3000!

Setup

After launching OpenHands, you must select an LLM Provider and LLM Model and enter a corresponding API Key. This can be done during the initial settings popup or by selecting the Settings button (gear icon) in the UI.

If the required model does not exist in the list, in Settings under the LLM tab, you can toggle Advanced options and manually enter it with the correct prefix in the Custom Model text box. The Advanced options also allow you to specify a Base URL if required.

Getting an API Key

OpenHands requires an API key to access most language models. Here's how to get an API key from the recommended providers:

<AccordionGroup>

1. [Log in to OpenHands Cloud](https://app.all-hands.dev).
2. Go to the Settings page and navigate to the `API Keys` tab.
3. Copy your `LLM API Key`.

OpenHands provides access to state-of-the-art agentic coding models with competitive pricing. [Learn more about OpenHands LLM provider](https://docs.openhands.dev/openhands/usage/llms/openhands-llms).



1. [Create an Anthropic account](https://console.anthropic.com/).
2. [Generate an API key](https://console.anthropic.com/settings/keys).
3. [Set up billing](https://console.anthropic.com/settings/billing).



1. [Create an OpenAI account](https://platform.openai.com/).
2. [Generate an API key](https://platform.openai.com/api-keys).
3. [Set up billing](https://platform.openai.com/account/billing/overview).



1. Create a Google account if you don't already have one.
2. [Generate an API key](https://aistudio.google.com/apikey).
3. [Set up billing](https://aistudio.google.com/usage?tab=billing).



If your local LLM server isn’t behind an authentication proxy, you can enter any value as the API key (e.g. `local-key`, `test123`) — it won’t be used.

</AccordionGroup>

Consider setting usage limits to control costs.

Using a Local LLM

Effective use of local models for agent tasks requires capable hardware, along with models specifically tuned for instruction-following and agent-style behavior.

To run OpenHands with a locally hosted language model instead of a cloud provider, see the Local LLMs guide for setup instructions.

Setting Up Search Engine

OpenHands can be configured to use a search engine to allow the agent to search the web for information when needed.

To enable search functionality in OpenHands:

  1. Get a Tavily API key from tavily.com.
  2. Enter the Tavily API key in the Settings page under LLM tab > Search API Key (Tavily)

For more details, see the Search Engine Setup guide.

Versions

The docker command above pulls the most recent stable release of OpenHands. You have other options as well:

  • For a specific release, replace $VERSION in openhands:$VERSION and runtime:$VERSION, with the version number. For example, 0.9 will automatically point to the latest 0.9.x release, and 0 will point to the latest 0.x.x release.
  • For the most up-to-date development version, replace $VERSION in openhands:$VERSION and runtime:$VERSION, with main. This version is unstable and is recommended for testing or development purposes only.

Next Steps