Install OpenCode on macOS, Linux, Windows
OpenCode is distributed as a single binary and supports multiple installation methods across macOS, Linux, and Windows. As of v1.3.0, OpenCode supports both Bun and Node.js runtimes.
Quick Install (Recommended)
The fastest way to install OpenCode is via our official script:
curl -fsSL https://opencode.ai/install | bash
This script detects your OS and architecture, downloads the correct binary, and adds it to your PATH.
Package Managers
npm / bun / pnpm / yarn
npm i -g opencode-ai@latest
# or
bun i -g opencode-ai@latest
# or
pnpm i -g opencode-ai@latest
# or
yarn global add opencode-ai@latest
Homebrew (macOS & Linux)
Recommended method (always up to date):
brew install anomalyco/tap/opencode
Official Homebrew formula (updated less frequently):
brew install opencode
Scoop (Windows)
scoop install opencode
Chocolatey (Windows)
choco install opencode
Arch Linux
# Stable version
sudo pacman -S opencode
# Latest from AUR
paru -S opencode-bin
mise (Any OS)
mise use -g opencode
Nix
# From nixpkgs
nix run nixpkgs#opencode
# Latest from GitHub
nix run github:anomalyco/opencode
Desktop App (BETA)
OpenCode is also available as a desktop application with a graphical interface.
Download
| Platform | Download |
|---|---|
| macOS (Apple Silicon) | opencode-desktop-darwin-aarch64.dmg |
| macOS (Intel) | opencode-desktop-darwin-x64.dmg |
| Windows | opencode-desktop-windows-x64.exe |
| Linux | .deb, .rpm, or AppImage |
Package Manager Installation
macOS (Homebrew):
brew install --cask opencode-desktop
Windows (Scoop):
scoop bucket add extras
scoop install extras/opencode-desktop
Windows Installation
WSL2 (Recommended)
On Windows, we recommend using WSL2 for the best experience:
# Install WSL2
wsl --install
# Restart your computer, then run:
curl -fsSL https://opencode.ai/install | bash
Native Windows (Experimental)
For native Windows installation, download the Windows binary from our GitHub Releases page and add it to your PATH.
Manual Installation
Download binaries directly from our GitHub Releases page.
macOS (Apple Silicon)
wget https://github.com/anomalyco/opencode/releases/latest/download/opencode-darwin-arm64
chmod +x opencode-darwin-arm64
mv opencode-darwin-arm64 /usr/local/bin/opencode
macOS (Intel)
wget https://github.com/anomalyco/opencode/releases/latest/download/opencode-darwin-amd64
chmod +x opencode-darwin-amd64
mv opencode-darwin-amd64 /usr/local/bin/opencode
Linux (x86_64)
wget https://github.com/anomalyco/opencode/releases/latest/download/opencode-linux-amd64
chmod +x opencode-linux-amd64
mv opencode-linux-amd64 /usr/local/bin/opencode
Linux (ARM64)
wget https://github.com/anomalyco/opencode/releases/latest/download/opencode-linux-arm64
chmod +x opencode-linux-arm64
mv opencode-linux-arm64 /usr/local/bin/opencode
Installation Directory
The install script respects the following priority order for the installation path:
$OPENCODE_INSTALL_DIR- Custom installation directory$XDG_BIN_DIR- XDG Base Directory Specification compliant path$HOME/bin- Standard user binary directory (if it exists or can be created)$HOME/.opencode/bin- Default fallback
Examples:
# Custom installation directory
OPENCODE_INSTALL_DIR=/usr/local/bin curl -fsSL https://opencode.ai/install | bash
# XDG compliant path
XDG_BIN_DIR=$HOME/.local/bin curl -fsSL https://opencode.ai/install | bash
Docker
For sandboxed environments, you can run OpenCode in a Docker container. For detailed Docker usage instructions, see our Docker Support page.
docker run -it -v $(pwd):/app anomalyco/opencode:latest
Verification
After installation, verify that OpenCode is working:
# Check version
opencode --version
# Start the TUI
opencode tui