Installation Options
Opencode provides multiple installation methods across different platforms. Use the tabs below to find the most suitable installation guide for your operating system.
macOS Installation
Recommended Method: Official Install Script
The easiest way to install Opencode on macOS is using our official install script:
curl -fsSL https://opencode.ai/install | bashHomebrew
For macOS users who prefer Homebrew:
brew install anomalyco/tap/opencodeManual Installation
Apple Silicon (M1/M2/M3)
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/opencodeIntel
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/opencodenpm
You can also install Opencode via npm:
npm install -g opencode-aiVerify Installation
After installation, verify that Opencode is correctly installed:
opencode --version Linux Installation
Recommended Method: Official Install Script
The easiest way to install Opencode on Linux is using our official install script:
curl -fsSL https://opencode.ai/install | bashArch Linux
For Arch Linux users, install OpenCode 1 from the AUR:
paru -S opencode-bin
# or
yay -S opencode-binManual Installation
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/opencodeARM64
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/opencodenpm
You can also install Opencode via npm:
npm install -g opencode-aiVerify Installation
After installation, verify that Opencode is correctly installed:
opencode --version Windows Installation
Recommended Method: WSL2
On Windows, we recommend using WSL2 for the best experience:
- Install WSL2 if you haven’t already:
wsl --install-
Restart your computer
-
Open WSL2 terminal and install Opencode using the official script:
curl -fsSL https://opencode.ai/install | bashNative Windows (Experimental)
For native Windows installation:
- Download the Windows binary from our GitHub Releases page
- Add the binary to your PATH environment variable
- Open Command Prompt or PowerShell and verify installation:
opencode --versionnpm
You can also install Opencode via npm on Windows:
npm install -g opencode-ai Docker Installation
For sandboxed environments, you can run Opencode in a Docker container:
docker run -it --rm -v $(pwd):/app ghcr.io/anomalyco/opencodeFor detailed Docker usage instructions, including DevOps integration, CI/CD pipeline setup, and advanced configuration, see our Docker Support page.
Troubleshooting
If you encounter any issues during installation, please open an issue on our GitHub repository.
Updating Opencode
To update Opencode to the latest version, you can use the same installation method you used initially. For example:
- Official script:
curl -fsSL https://opencode.ai/install | bash - Homebrew:
brew upgrade anomalyco/tap/opencode - npm:
npm install -g opencode-ai@latest - AUR:
paru -Syu opencode-binoryay -Syu opencode-bin
Uninstalling Opencode
To uninstall Opencode:
- Official script:
opencode uninstall - Homebrew:
brew uninstall anomalyco/tap/opencode - Manual installation:
rm /usr/local/bin/opencode - npm:
npm uninstall -g opencode-ai - Docker: Remove the container and image as needed