Alternative Installation Methods
The official
curl ... | bashscript doesn't work for you? Here are other options.
When to Use This Page
- Official installation script times out
- You prefer package managers (npm, Homebrew, Scoop, etc.)
- Company computer has installation restrictions
- You want to try Docker without installing on your system
macOS / Linux
Homebrew (Recommended)
brew install anomalyco/tap/opencodeNote
The official Homebrew formula is anomalyco/tap/opencode. The community-maintained brew install opencode updates slowly and is not recommended.
npm / pnpm / bun / yarn
Requires Node.js 18+ (22+ recommended).
npm install -g opencode-aipnpm install -g opencode-aibun install -g opencode-aiyarn global add opencode-aiArch Linux
sudo pacman -S opencode # Stable version (recommended)
paru -S opencode-bin # AUR latest versionWindows
Chocolatey
Run PowerShell as Administrator:
choco install opencodeScoop (Recommended)
Run as regular user:
scoop bucket add extras
scoop install extras/opencodeHaven't installed Scoop?
Run the following commands in order:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserInvoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expressionscoop install gitIf your PowerShell is running as Administrator, use this instead when installing Scoop:
iex "& {$(irm get.scoop.sh)} -RunAsAdmin"npm
Requires Node.js 18+:
npm install -g opencode-aiMise
mise use -g github:anomalyco/opencodeDocker (Great for Trying Out)
Don't want to install on your system? Try with Docker:
docker run -it --rm ghcr.io/anomalyco/opencodeLimitation
OpenCode running in Docker can only access files inside the container by default. If you want it to read/write files on your computer, you need to mount a directory:
docker run -it --rm -v $(pwd):/workspace -w /workspace ghcr.io/anomalyco/opencodeNot very beginner-friendly. Recommend using the one-line script or package manager first.
Manual Download
Download the binary for your platform from GitHub Releases, extract it, and place it in a PATH directory.
Installation Script Advanced Parameters
The official installation script curl -fsSL https://opencode.ai/install | bash supports these parameters:
# Install a specific version
curl -fsSL https://opencode.ai/install | bash -s -- --version 1.1.6
# Don't modify shell config (don't auto-add to PATH)
curl -fsSL https://opencode.ai/install | bash -s -- --no-modify-path
# Install from local binary
./install --binary /path/to/opencodeInstallation Location
The official script installs to $HOME/.opencode/bin by default. To install elsewhere, move the binary after installation:
# Move to /usr/local/bin after installation
sudo mv ~/.opencode/bin/opencode /usr/local/bin/opencodeInstallation Locations
| Method | Binary Location | Config Location |
|---|---|---|
| Official Script | ~/.opencode/bin/opencode | ~/.config/opencode/opencode.json |
| npm/pnpm/bun/yarn | Global node_modules | Same as above |
| Homebrew | /opt/homebrew/bin/opencode or /usr/local/bin/opencode | Same as above |
| Scoop | ~/scoop/apps/opencode/current/opencode.exe | Same as above |
| Chocolatey | C:\ProgramData\chocolatey\bin\opencode.exe | Same as above |
Next Steps
After installation, go back to 1.2 Installation and follow the "Verify Installation" step to confirm opencode --version outputs correctly.
If you encounter issues, see 1.2b Troubleshooting Installation

