Skip to content

Install OpenCode on macOS, Linux, Windows

OpenCode is distributed as a single binary and supports multiple installation methods across macOS, Linux, and Windows. The current release supports both Bun and Node.js runtimes; check the latest release for version-specific requirements.

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)

OpenCode 1 tap (recommended for V1, always up to date):

brew install anomalyco/tap/opencode

Official Homebrew formula:

brew install opencode

Scoop (Windows)

scoop install opencode

Chocolatey (Windows)

choco install opencode

Arch Linux

# OpenCode 2 (official Arch package)
sudo pacman -S opencode

# OpenCode 1 (from AUR)
paru -S opencode-bin

mise (Any OS)

# OpenCode 1 (installs from the GitHub repo)
mise use -g github:anomalyco/opencode

Nix

nix run github:anomalyco/opencode

Desktop App (Beta)

OpenCode is also available as a desktop application with a graphical interface. Desktop availability and platform support can change between releases; check the official download page before installing.

Download

PlatformDownload
macOS (Apple Silicon)opencode-desktop-mac-arm64.dmg
macOS (Intel)opencode-desktop-mac-x64.dmg
Windows (x64)opencode-desktop-win-x64.exe
Linux.deb, .rpm, or AppImage

Package Manager Installation

macOS (Homebrew):

brew install --cask opencode-desktop

Windows (Scoop, community bucket):

scoop bucket add extras
scoop install extras/opencode-desktop

Windows Installation

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. Release assets are archives (zip on macOS/Windows, tar.gz on Linux).

macOS (Apple Silicon)

wget https://github.com/anomalyco/opencode/releases/download/v2.3.0/opencode-darwin-arm64.zip
unzip opencode-darwin-arm64.zip
chmod +x opencode-darwin-arm64
sudo mv opencode-darwin-arm64 /usr/local/bin/opencode

macOS (Intel)

wget https://github.com/anomalyco/opencode/releases/download/v2.3.0/opencode-darwin-x64.zip
unzip opencode-darwin-x64.zip
chmod +x opencode-darwin-x64
sudo mv opencode-darwin-x64 /usr/local/bin/opencode

Linux (x86_64)

wget https://github.com/anomalyco/opencode/releases/download/v2.3.0/opencode-linux-x64.tar.gz
tar -xzf opencode-linux-x64.tar.gz
chmod +x opencode-linux-x64
sudo mv opencode-linux-x64 /usr/local/bin/opencode

Linux (ARM64)

wget https://github.com/anomalyco/opencode/releases/download/v2.3.0/opencode-linux-arm64.tar.gz
tar -xzf opencode-linux-arm64.tar.gz
chmod +x opencode-linux-arm64
sudo mv opencode-linux-arm64 /usr/local/bin/opencode

Which build do you get? The manual-download links above point at OpenCode 2 (v2.3.0). GitHub’s releases/latest currently resolves to the V1 maintenance line (v1.19.6), so a releases/latest/download/... URL would hand you an OpenCode 1 build.

Installation Directory

The install script respects the following priority order for the installation path:

  1. $OPENCODE_INSTALL_DIR - Custom installation directory
  2. $XDG_BIN_DIR - XDG Base Directory Specification compliant path
  3. $HOME/bin - Standard user binary directory (if it exists or can be created)
  4. $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 --rm -v $(pwd):/app ghcr.io/anomalyco/opencode

Verification

After installation, verify that OpenCode is working:

# Check version
opencode --version

# Start the TUI
opencode

Next Steps