Tutorials

How to Use OpenHands: Run an AI Coding Agent on Your Own Code

Run an AI coding agent on your own code with OpenHands Agent Canvas — start with the Docker sandbox, give it one small task, and review every change.

Developer working with code on a computer screen, illustrating the OpenHands AI coding agent tutorial
Image: Pixabay / Pixabay Content License
Time Required
About 1 Hour
Difficulty
Advanced (Docker / Node.js)
Tools Covered
OpenHands Agent Canvas + Docker

What You'll Learn (Key Takeaways)

  • OpenHands (formerly OpenDevin) is a free, open-source platform for AI-driven software development, with Agent Canvas as its self-hosted control center.
  • Start with the Docker sandbox: it limits what the agent can touch. Avoid the no-sandbox and from-source options unless full filesystem access is acceptable.
  • Open the UI, add a backend, give the agent one small concrete task, bring your own model, and review every change as a diff.
  • Bottom line: worth a pilot if your team already maintains code and has a developer to review — remember it is still beta.

What it is

OpenHands is an open-source project for AI-driven software development. Its GitHub repository, now at OpenHands/OpenHands (91,120 stars, checked 2026-10-17; the old All-Hands-AI/OpenHands address redirects to the new home), was formerly known as OpenDevin. As of the current README, the repository ships Agent Canvas, a self-hosted developer control center for coding agents and automations. In plain terms, it is a web dashboard where you can run coding agents against your own projects, switch between local, remote, and cloud backends, and set up automations that run on a schedule or in response to events. Out of the box it runs the open-source OpenHands agent, and it can also use third-party agents such as Claude Code, Codex, Gemini CLI, Pi, and OpenCode, or any ACP-compatible agent. It is a developer tool, not a chatbot: the agent reads and changes real code.

Note: the README currently carries a beta status badge. Treat OpenHands as a powerful tool that needs careful setup and supervision, especially before you expose it beyond your own machine.

Who it is for / SMB use case

OpenHands is for small businesses that already build or maintain software — a company website, a booking flow, an internal tool — and want an AI coding agent working inside their own codebase. It fits teams with at least one developer who can review the agent’s changes. Practical SMB use cases include:

  • Small code tasks: fix a bug, add a form field, or update a page, then have a developer review the diff before merging.
  • Repo chores: generate reports from the codebase, decompose a GitHub issue into smaller tasks, or draft dependency-update pull requests.
  • Scheduled automations: run agents on a schedule or in response to webhook events — for example, publishing a generated report to Slack.

If your business does not write code, OpenHands is not the right tool — the AI writing tools covered elsewhere on this site are a better fit.

Installation

There are four install options in the README. The Docker option is the safest starting point for most small teams because it sandboxes the agent. Pick one option and follow it exactly.

Prerequisites: Docker (Docker Desktop on macOS/Windows, or Docker Engine/Desktop on Linux), and a host directory for PROJECTS_PATH containing the project folders you want the agent to access. Create it before starting the container. On macOS or Linux:

export PROJECTS_PATH="$HOME/projects"  # directory containing your project folders
mkdir -p "$PROJECTS_PATH" "$HOME/.openhands"

docker run -it --rm \
  -p 127.0.0.1:8000:8000 \
  -e AGENT_CANVAS_ALLOW_LAN_SESSION_KEY=true \
  -v "$HOME/.openhands:/home/openhands/.openhands" \
  -v "${PROJECTS_PATH}:/projects" \
  ghcr.io/openhands/agent-canvas:1.27.1

For Windows, see README.windows.md in the repository for the equivalent commands. The agent will be able to access any project under PROJECTS_PATH.

Option B: Without a sandbox (fast, but riskier)

Prerequisites: Node.js 24 or later, and uv. This runs the agent server directly on your machine, and the agent will have full access to your filesystem:

npm install -g @openhands/agent-canvas
agent-canvas

You can also split the stack with agent-canvas --frontend-only or agent-canvas --backend-only. Only use this option where full filesystem access for the agent is acceptable.

Option C: Multiple Docker sandboxes

Prerequisites: Node.js 24 or later, uv, and running Docker. Install the package, then start with the Docker conversation runtime:

npm install -g @openhands/agent-canvas
OH_CONVERSATION_RUNTIME=docker agent-canvas

This runs each new conversation in its own Docker container, useful for running several agents concurrently.

Option D: From source

Prerequisites: Node.js 24 or later, npm, and uv (for running the agent server via uvx). This also runs the agent server directly on your machine with full filesystem access:

git clone https://github.com/OpenHands/OpenHands.git
cd OpenHands
npm install
npm run dev

After starting, access the UI at http://localhost:8000 for the npm/source launchers, or http://localhost:8000/canvas for the Docker image. You can add additional backends directly from the UI. For internet-facing installs, follow the self-hosting guide in the repository, especially the security hardening section.

How to use

Step 1: Open the UI and add a backend

Agent Canvas can connect to multiple agent servers — a personal one on your laptop, a shared one for the team. Add backends from the UI.

Step 2: Start a conversation with a small, concrete task

Start a new conversation and give the agent one narrow job in plain language, for example: “In the project under /projects/my-website, find the contact form validation and add a required check for the phone field, then show me the diff.” Narrow tasks are easier to review and less likely to wander into unrelated files.

Step 3: Choose your model and agent

Agent Canvas supports bringing your own model — it works with any LLM, per the README — and switching between agents such as the built-in OpenHands agent, Claude Code, Codex, Gemini CLI, Pi, or OpenCode. Pick the agent and model your team already uses, and keep that choice consistent while you evaluate the tool.

Step 4: Review every change before accepting it

Read the agent’s proposed changes as a diff, run your project’s tests, and only then merge. Never let an agent push directly to your main branch without a human review.

Step 5: Set up one automation

Once manual tasks work, create one automation — for example, a scheduled run that generates a weekly report and publishes it to Slack. Start with one, watch it run twice, then add more.

Pricing / Limitations

OpenHands is free open-source software under the MIT license, and self-hosting it costs nothing beyond your own machine or server. What you pay for is the LLM behind the agent, billed by your model provider, plus any infrastructure you run. The README also mentions optional OpenHands Cloud and OpenHands Enterprise infrastructure; check the official site for current pricing, which the README does not state. Limitations to plan around:

  • Beta status: expect rough edges, changing interfaces, and the occasional failed run. Keep human review mandatory.
  • Security: the no-sandbox and from-source options give the agent full filesystem access. Use Docker sandboxes, keep the UI on loopback (127.0.0.1), and follow the self-hosting hardening guide before any internet-facing install.
  • Requirements: Node.js 24 or later, uv, and Docker for the sandboxed options. Older machines may struggle.
  • Scope creep: coding agents can edit more than you asked. Narrow prompts, small tasks, and diff review are the controls that keep this safe.

Bottom line for SMB

OpenHands Agent Canvas is worth a pilot if your small business already maintains code and has a developer who can review agent output. Start with the Docker sandbox option, one narrow task, and mandatory diff review. Skip it if nobody on your team reads code — an agent with filesystem access is not a tool to run unsupervised. Full setup details: docs.openhands.dev.

FAQ

Is OpenHands the same as OpenDevin?

Yes, in lineage. OpenDevin was the earlier name; the project is now OpenHands, and the current repository ships Agent Canvas as its control center.

Do I need Docker to run OpenHands?

No, but Docker is recommended. Without it, the agent server runs directly on your machine with full filesystem access, which is riskier.

Can I use my own LLM with OpenHands?

Yes. The README says you can bring your own model and use it with any LLM. Check the official docs for the current model configuration steps.

Frequently Asked Questions

Is OpenHands the same as OpenDevin?

Yes, in lineage. OpenDevin was the earlier name; the project is now OpenHands, and the old repository address redirects to the new home.

Do I need Docker to run OpenHands?

No, but Docker is recommended. Without it, the agent server runs directly on your machine with full filesystem access.

Can I use my own LLM with OpenHands?

Yes. The README says you can bring your own model and use it with any LLM. Check the official docs for model setup.

WebGool Tech Senior AI & Small Business Editor
Verified Contributor

Keep Reading

More in Tutorials

Explore all

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top