Skip to main content
OpenCode can be installed on macOS, Linux, and Windows using multiple package managers and installation methods.

Quick Install

The fastest way to install OpenCode is using the installation script:
curl -fsSL https://opencode.ai/install | bash
This script automatically detects your platform and installs the latest version.

Prerequisites

Before installing OpenCode, ensure you have:
  1. A modern terminal emulator for the best experience:
    • WezTerm - Cross-platform, highly recommended
    • Alacritty - Cross-platform, GPU-accelerated
    • Ghostty - Linux and macOS
    • Kitty - Linux and macOS
  2. API keys for your preferred LLM providers (configured after installation)

Installation Methods

Install from the OpenCode tap for the most up-to-date releases:
brew install anomalyco/tap/opencode
Or use the official Homebrew formula (updated less frequently):
brew install opencode

Node.js Package Managers

npm install -g opencode-ai

Mise

mise use -g github:anomalyco/opencode

Nix

nix run nixpkgs#opencode
For the latest development version:
nix run github:anomalyco/opencode

Desktop App (Beta)

OpenCode is also available as a desktop application with a native GUI experience.

Download

Download directly from the releases page or opencode.ai/download.
PlatformDownload File
macOS (Apple Silicon)opencode-desktop-darwin-aarch64.dmg
macOS (Intel)opencode-desktop-darwin-x64.dmg
Windowsopencode-desktop-windows-x64.exe
Linux (Debian/Ubuntu)opencode-desktop-linux-x64.deb
Linux (Fedora/RHEL)opencode-desktop-linux-x64.rpm
Linux (AppImage)opencode-desktop-linux-x64.AppImage

Install via Package Manager

brew install --cask opencode-desktop

Custom Installation Directory

The installation script respects environment variables for custom installation paths:
# Custom 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

Priority Order

  1. $OPENCODE_INSTALL_DIR - Custom installation directory
  2. $XDG_BIN_DIR - XDG Base Directory Specification path
  3. $HOME/bin - Standard user binary directory
  4. $HOME/.opencode/bin - Default fallback

Manual Download

Grab the binary directly from the GitHub Releases page:
  1. Download the appropriate binary for your platform
  2. Extract the archive
  3. Move the binary to a directory in your $PATH
  4. Make it executable: chmod +x opencode

Verify Installation

Confirm OpenCode is installed correctly:
opencode --version
You should see the version number printed to the console.

Upgrading

brew upgrade opencode
Remove versions older than 0.1.x before installing or upgrading to avoid compatibility issues.

Uninstalling

To remove OpenCode from your system:
brew uninstall opencode
Remove configuration files:
rm -rf ~/.config/opencode
rm -rf ~/.opencode

Next Steps

Quick Start

Configure OpenCode and start your first session

Configuration

Customize OpenCode to match your workflow