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)
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
- Open your workspace in Edge or Chrome.
- Tap Launch, choose OpenCode and tap Sign in: it runs
opencode providers loginfor you in the terminal. For an API key, choose Set key instead and pasteANTHROPIC_API_KEY,OPENAI_API_KEY,GEMINI_API_KEYorGOOGLE_API_KEY; the workspace keeps it write-only. - 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.
- Give it a task. The image sets
OPENCODE_PERMISSION={"*":"allow"}, so OpenCode never asks. - Prefer a terminal window? Windows’ built-in OpenSSH client (
sshin 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:
choco install opencode
Scoop:
scoop install opencode
npm:
npm install -g opencode-ai
Through WSL
WSL runs a Linux distribution inside Windows (Microsoft’s guide). Install it from an administrator PowerShell and restart:
wsl --install
Then install OpenCode in the Ubuntu terminal it opens:
curl -fsSL https://opencode.ai/install | bash