# OpenCode on Windows

> How OpenCode runs on Windows today, the install commands, and the route with nothing to install: an always-on Linux workspace you open in Edge or Chrome, signed in once from the Launch menu.

_Updated November 23, 2026 · Checked against OpenCode 1.18.32 in EnvHaven v1.9.0_

OpenCode runs on Windows natively or through WSL. The OpenCode 1 docs recommend WSL for better file system performance and full terminal support. ([OpenCode documentation](https://opencode.ai/v1/docs/windows-wsl))

There is also a way that leaves Windows out of it: in EnvHaven, OpenCode runs on a Linux workspace of its own and the PC is only the window. Nothing to install on the PC, no WSL to set up, and the PC can sleep while OpenCode works.

## OpenCode from Windows, on EnvHaven

1. Open your workspace in Edge or Chrome.
2. Tap **Launch**, choose OpenCode and tap **Sign in**: it runs `opencode providers login` for you in the terminal. For an API key, choose **Set key** instead and paste `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY` or `GOOGLE_API_KEY`; the workspace keeps it write-only.
3. Start it with one tap: signed in, OpenCode gets a green dot in the Launch menu and an icon in the workspace's top bar. Support is built in (1.18.32), so there is nothing to install or update.
4. Give it a task. The image sets `OPENCODE_PERMISSION={"*":"allow"}`, so OpenCode never asks.
5. Prefer a terminal window? Windows' built-in OpenSSH client (`ssh` in Windows Terminal or PowerShell) connects to the workspace and lands in the same session. First add your public key, or import it from GitHub, under Remote Access in the workspace's EnvHaven sidebar.

## Install OpenCode on Windows itself

Chocolatey:

```powershell
choco install opencode
```

Scoop:

```powershell
scoop install opencode
```

npm:

```bash
npm install -g opencode-ai
```

## Through WSL

WSL runs a Linux distribution inside Windows ([Microsoft's guide](https://learn.microsoft.com/en-us/windows/wsl/install)). Install it from an administrator PowerShell and restart:

```powershell
wsl --install
```

Then install OpenCode in the Ubuntu terminal it opens:

```bash
curl -fsSL https://opencode.ai/install | bash
```

## Keep reading

- [OpenCode](https://envhaven.com/agents/opencode)
- [OpenCode in the browser](https://envhaven.com/agents/opencode/browser)
- [OpenCode on iPhone](https://envhaven.com/agents/opencode/iphone)
- [OpenCode on iPad](https://envhaven.com/agents/opencode/ipad)
- [OpenCode on Android](https://envhaven.com/agents/opencode/android)
- [OpenCode on a Chromebook](https://envhaven.com/agents/opencode/chromebook)
- [Coding agents on Windows](https://envhaven.com/agents/windows)

Source: https://envhaven.com/agents/opencode/windows
