> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openhands.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Setup

> Legacy local GUI setup; use Agent Canvas for maintained local installation.

> [!WARNING]
>
> **This is the deprecated legacy local GUI.** Its CLI launcher, `openhands serve`, is no longer actively maintained.
> Local OpenHands installation is still supported through [Agent Canvas with npm, npx, or Docker](https://docs.openhands.dev/openhands/usage/agent-canvas/setup.md#install-and-run).
> The instructions below are retained for legacy users and do not install Agent Canvas.

## Legacy Local GUI Setup

### System Requirements

* MacOS with [Docker Desktop support](https://docs.docker.com/desktop/setup/install/mac-install/#system-requirements)
* Linux
* Windows with [WSL](https://learn.microsoft.com/en-us/windows/wsl/install) and [Docker Desktop support](https://docs.docker.com/desktop/setup/install/windows-install/#system-requirements)

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

### Prerequisites

> [accordion] MacOS
>
> **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.

> [accordion] Linux
>
> > [!NOTE]
> >
> > Tested with Ubuntu 22.04.
>
> **Docker Desktop**
>
> 1. [Install Docker Desktop on Linux](https://docs.docker.com/desktop/setup/install/linux/).

> [accordion] Windows
>
> > [!NOTE]
> >
> > 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.
>
> > [!NOTE]
> >
> > 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.

### Start the App

#### Option 1: Using the Legacy CLI Launcher with uv

The legacy CLI requires [uv](https://docs.astral.sh/uv/) 0.11.6 or newer. uv provides better isolation from your current project's virtual environment and is required for OpenHands' default MCP servers (like the [fetch MCP server](https://github.com/modelcontextprotocol/servers/tree/main/src/fetch)).

**Install uv** (if you haven't already):

See the [uv installation guide](https://docs.astral.sh/uv/getting-started/installation/) for the latest installation instructions for your platform.

**Install OpenHands**:

```bash theme={null}
uv tool install openhands --python 3.12
```

**Launch OpenHands**:

```bash theme={null}
# 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**:

```bash theme={null}
uv tool upgrade openhands --python 3.12
```

> [accordion] Alternative: Traditional pip installation
>
> If you prefer to use pip and have Python 3.12+ installed:
>
> ```bash theme={null}
> # 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

> [accordion] Docker Command (Click to expand)
>
> ```bash theme={null}
> 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](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:

> [accordion] OpenHands (Recommended)
>
> 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.md).

> [accordion] Anthropic (Claude)
>
> 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).

> [accordion] OpenAI
>
> 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).

> [accordion] Google (Gemini)
>
> 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).

> [accordion] Local LLM (e.g. LM Studio, llama.cpp, Ollama)
>
> 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.

Consider setting usage limits to control costs.

#### Using a Local LLM

> [!NOTE]
>
> 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](https://docs.openhands.dev/openhands/usage/llms/local-llms.md) 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](https://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](https://docs.openhands.dev/openhands/usage/advanced/search-engine-setup) guide.

### Versions

The [Docker command above](#start-the-app) pins the legacy GUI image to `1.8` and the agent server image to `1.26.0-python`.
These are legacy versions, not the latest Agent Canvas release. For maintained installation and update commands,
see [Agent Canvas installation](https://docs.openhands.dev/openhands/usage/agent-canvas/setup.md).

## Next Steps

* [Mount your local code into the sandbox](https://docs.openhands.dev/openhands/usage/sandboxes/docker#mounting-your-code-into-the-sandbox) to use OpenHands with your repositories
* [Run OpenHands in a scriptable headless mode.](https://docs.openhands.dev/openhands/usage/cli/headless)
* [Run OpenHands with a friendly CLI.](https://docs.openhands.dev/openhands/usage/cli/quick-start)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.