OpenCode: OpenCode Installation
Last updated: 2026-08-31
OpenCode supports multi-platform installation. The one-click script is recommended for quick setup.
1. What You Will Learn
- System requirements
- One-click installation method
- Platform-specific installation
- Verification and startup
2. System Requirements
(1) Operating Systems
| OS | Support |
|---|---|
| macOS | ✅ Fully supported |
| Linux | ✅ Fully supported |
| Windows | ⚠️ WSL recommended |
(2) Terminal Tools
A modern terminal is recommended for the best experience:
| Terminal | Platform | Notes |
|---|---|---|
| WezTerm | Cross-platform | Recommended |
| Alacritty | Cross-platform | Excellent performance |
| Ghostty | Linux/macOS | Emerging choice |
| Kitty | Linux/macOS | GPU accelerated |
(3) API Key
OpenCode doesn't include models—you need to configure an AI provider:
- OpenCode Zen (official selection, includes free models)
- OpenAI (GPT)
- Anthropic (Claude)
- DeepSeek
- Alibaba Bailian
- GLM / MiniMax
3. One-Click Installation (Recommended)
For macOS / Linux / WSL:
curl -fsSL https://opencode.ai/install | bash
After installation, navigate to your project and start:
cd <project>
opencode
4. Node.js Installation
If you're familiar with Node.js:
npm install -g opencode-ai
Or with pnpm:
pnpm install -g opencode-ai
Or with yarn:
yarn global add opencode-ai
5. Platform-Specific Installation
(1) macOS (Homebrew)
brew install anomalyco/tap/opencode
The official tap is recommended for faster updates.
brew install opencodeupdates more slowly.
(2) Windows
WSL is recommended for stability and full feature support.
Other methods:
# Chocolatey
choco install opencode
# Scoop
scoop install opencode
# NPM
npm install -g opencode-ai
# Mise
mise use -g github:anomalyco/opencode
# Docker
docker run -it --rm ghcr.io/anomalyco/opencode
You can also download binaries directly from the GitHub Releases page.
(3) Linux
# Universal method (recommended)
curl -fsSL https://opencode.ai/install | bash
# Arch Linux
sudo pacman -S opencode
# or
paru -S opencode-bin
# Docker
docker run -it --rm ghcr.io/anomalyco/opencode
6. Verify Installation
opencode --version
Output similar to the following indicates success:
1.1.50
7. Start OpenCode
opencode
If you encounter EACCES: permission denied, fix directory permissions:
BASHsudo chown -R $(whoami) ~/.local chmod -R 755 ~/.local
8. Permission Troubleshooting
| Issue | Solution |
|---|---|
| EACCES: permission denied | sudo chown -R $(whoami) ~/.local |
| command not found | Check if PATH includes the installation directory |
| Version too old | Run opencode upgrade |
❓ FAQ
npm prefix -g to find the global installation path, then add its bin directory to PATH.-v: docker run -it --rm -v $(pwd):/workspace ghcr.io/anomalyco/opencode.📖 Summary
- One-click install
curl -fsSL https://opencode.ai/install | bashis the fastest method - Windows users should use WSL
- Node.js installation suits frontend developers
- Fix permission issues with
chownandchmod - Verify with
opencode --version
📝 Exercises
-
Basic: Install OpenCode on your OS and verify the version number.
-
Intermediate: Try two different installation methods and compare their pros and cons.
-
Advanced: Run OpenCode in Docker with a mounted local project directory.