Check the runtime
Prepare Node.js LTS, Git, a clean project folder, and a terminal that can reach your model provider.
2026 practical guide
This guide is for developers who want OpenCode running quickly. It covers the environment check, CLI installation, provider connection, project configuration, validation tasks, and the common failures that usually block a first deployment.
Quick Start
Use this sequence for a first install or when moving the same setup to a new machine.
Prepare Node.js LTS, Git, a clean project folder, and a terminal that can reach your model provider.
Use the official installation method, then confirm the opencode command is available in the current terminal.
Add one provider first. Keep API keys in environment variables or a secure credential store, not in the repository.
Start with a stable and affordable model. Verify the model ID from the provider dashboard or API docs.
Use opencode.json for non-secret project preferences such as permissions, ignored paths, and default model choices.
Ask OpenCode to explain a file, edit a low-risk file, and run a test or formatting command.
Record your Node version, provider, proxy settings, default model, and common errors for later reuse.
Provider
Most deployment failures come from API keys, base URLs, model names, proxy settings, or overly broad permissions. Connect one provider first, then add backups.
| Check | Recommended action | Common mistake |
|---|---|---|
| API key | Store it outside the repository. | Committing secrets to Git. |
| Base URL | Use the official or compatible endpoint. | Missing protocol or using the wrong path. |
| Model name | Copy the real model ID. | Using a marketing name instead of an API ID. |
| Permissions | Start conservatively and loosen after validation. | Allowing every command before testing. |
Use this as a non-secret configuration shape. Confirm exact fields with your OpenCode version.
{
"model": "provider/model-id",
"permission": { "edit": "ask", "bash": "ask" },
"ignore": ["node_modules", ".env", "dist"]
}
Platform Notes
Use PowerShell for simple projects. Switch to WSL when your repository depends heavily on Linux tooling.
Confirm which Node installation your terminal is using, especially if you mix Homebrew, nvm, and system Node.
Use a normal user, protect API keys, and avoid long-running development tasks under root.
Troubleshooting
FAQ
Install Node.js LTS, Git, a usable terminal, and at least one model provider API key.
Project-level configuration usually belongs in the repository root, but never commit secrets.
Run three small checks: read a file, edit a low-risk file, and run a test or formatting command.