---
title: OpenCode
description: Deploy OpenCode, an open-source AI coding agent that runs in your terminal, pre-configured to use DigitalOcean Gradient AI for inference. Use natural …
product: Marketplace
url: https://docs.digitalocean.com/products/marketplace/catalog/opencode/
last_updated: "2026-08-04"
---

> **For AI agents:** The documentation index is at [https://docs.digitalocean.com/llms.txt](https://docs.digitalocean.com/llms.txt). Markdown versions of pages use the same URL with `index.html.md` in place of the HTML page (for example, append `index.html.md` to the directory path instead of opening the HTML document).

# OpenCode

Generated on 4 Aug 2026 from [the OpenCode catalog page](https://marketplace.digitalocean.com/apps/opencode)

## OpenCode 1-Click Application

Deploy OpenCode, an open-source AI coding agent that runs in your terminal, pre-configured to use DigitalOcean Gradient AI for inference. Use natural language to write, debug, and refactor code. Code and context stay local by default.

## What is OpenCode?

OpenCode brings AI assistance into the command line. It’s a terminal-based coding agent pre-configured with DigitalOcean Gradient AI, giving you access to Llama 3.3 70B, Qwen3, DeepSeek, and more using a single Gradient model access key.

- **Terminal-first** – Works natively in your shell, no web interface required
- **DigitalOcean Gradient AI** – Pre-configured with open-source models via Gradient inference
- **Multiple sessions** – Run multiple agents for different tasks
- **File references** – Use `@filename` to include files in context
- **Shell commands** – Execute commands with `!` prefix
- **Slash commands** – `/init`, `/connect`, `/share` and more
- **Privacy-focused** – Code stays on your server by default

## Key Features

- Natural language coding assistance in the terminal
- Pre-configured with DigitalOcean Gradient AI (Claude, GPT, DeepSeek, Llama, and more)
- Works with existing projects—navigate, edit, and run code
- No IDE required—pure terminal workflow

## System Requirements

OpenCode is lightweight; most compute happens at the LLM provider.

| Use Case | RAM | CPU | Storage |
|---|---|---|---|
| Minimum | 1 GB | 1 vCPU | 25 GB |
| Recommended | 2 GB | 2 vCPU | 50 GB |

## Included System Components

- **Ubuntu 24.04 LTS** – Base operating system
- **OpenCode** – AI coding agent (version 1.14.32)
- **DigitalOcean Gradient AI** – Pre-configured inference provider
- **Git** – Version control
- **UFW Firewall** – SSH only (rate-limited)

## Software Included

*This Marketplace listing does not include a detailed software list.*

## Creating an App using the Control Panel

Click the **Deploy to DigitalOcean** button to create a Droplet based on this 1-Click App. If you aren’t logged in, this link will prompt you to log in with your DigitalOcean account.

[![Deploy to DO](https://www.deploytodo.com/do-btn-blue.svg)](https://cloud.digitalocean.com/droplets/new?image=opencode)

## Creating an App using the API

In addition to creating a Droplet from the OpenCode 1-Click App using the control panel, you can also use the [DigitalOcean API](https://docs.digitalocean.com/reference/api). As an example, to create a 4GB OpenCode Droplet in the SFO2 region, you can use the following `curl` command. You need to either save your [API access token](https://docs.digitalocean.com/reference/api/create-personal-access-token/index.html.md) to an environment variable or substitute it in the command below.

```shell
curl -X POST -H 'Content-Type: application/json' \
         -H 'Authorization: Bearer '$TOKEN'' -d \
        '{"name":"choose_a_name","region":"sfo2","size":"s-2vcpu-4gb","image":"opencode"}' \
        "https://api.digitalocean.com/v2/droplets"
```

## Getting Started After Deploying OpenCode

## Getting Started

### 1. Deploy the Droplet

1. Select this 1-Click App from the DigitalOcean Marketplace
2. Choose a Droplet size (1 GB RAM minimum)
3. Add your SSH key for secure access
4. Create the Droplet

### 2. SSH In

```
ssh root@your-droplet-ip
```

### 3. Complete the Setup Wizard

If you passed `GRADIENT_KEY` as a droplet environment variable, OpenCode is already configured — skip to step 4.

Otherwise, on first login the setup wizard will prompt for your DigitalOcean Gradient model access key. To create one:

1. Go to [https://cloud.digitalocean.com/gen-ai/model-access-keys](https://cloud.digitalocean.com/gen-ai/model-access-keys)
2. Click **Create Model Access Key**
3. Copy the new key
4. Paste the key when prompted by the setup wizard

The wizard verifies your key and configures OpenCode automatically.

### 4. Run OpenCode

```
cd /path/to/your/project
opencode
```

The default model is **Kimi K2.5** (`digitalocean/kimi-k2.5` via DigitalOcean Gradient). You can change it in `/root/.config/opencode/opencode.json` or use the `/models` command inside OpenCode.

## Managing OpenCode

### Helper Scripts

| Action | Command |
|---|---|
| Check version | `/opt/opencode-version.sh` |
| Update to latest | `/opt/update-opencode.sh` |
| Re-run setup wizard | `/opt/setup-opencode.sh` |
| Apply Gradient from env | `/opt/apply-gradient-from-env.sh` |

### Configuration

- **OpenCode config**: `/root/.config/opencode/opencode.json`
- **Auth / API key**: `/root/.local/share/opencode/auth.json`
- **Gradient env vars**: `/opt/opencode.env` (`GRADIENT_KEY`, `GRADIENT_MODEL`)
- **Getting started guide**: `cat /root/opencode_info.txt`

### Inference usage (Gradient)

API `usage` may list cache-related fields, but on DigitalOcean Gradient’s OpenAI-compatible inference they are **often zero** regardless of model. Treat **DigitalOcean billing and documentation** as the source of truth for charges. The same note is in `/root/opencode_info.txt`. If you add providers with `/connect`, their APIs define usage and any prompt-cache behavior.

### Pre-Configured Models

The following models are available via DigitalOcean Gradient (only a Gradient model access key is required). Use the full `provider/model-id` value in OpenCode or in `"model"` in `opencode.json`.

**`digitalocean`** (OpenAI-compatible; default **Kimi K2.5**)

| Model | Full model id |
|---|---|
| Kimi K2.5 (default) | `digitalocean/kimi-k2.5` |
| GPT-5.2 | `digitalocean/openai-gpt-5.2` |
| GPT-5 | `digitalocean/openai-gpt-5` |
| GPT-4.1 | `digitalocean/openai-gpt-4.1` |
| OpenAI o3 | `digitalocean/openai-o3` |
| DeepSeek R1 Distill Llama 70B | `digitalocean/deepseek-r1-distill-llama-70b` |
| Qwen3 32B | `digitalocean/alibaba-qwen3-32b` |
| Llama 3.3 70B Instruct | `digitalocean/llama3.3-70b-instruct` |
| glm-5 | `digitalocean/glm-5` |
| MiniMax M2.5 | `digitalocean/minimax-m2.5` |
| Claude Opus 4.6 | `digitalocean/claude-opus-4-6` |
| Claude Opus 4.5 | `digitalocean/claude-opus-4-5` |
| Claude Sonnet 4.5 | `digitalocean/claude-sonnet-4-5` |
| Claude Sonnet 4 | `digitalocean/claude-sonnet-4-6` |

To change the default model, edit `"model"` in `/root/.config/opencode/opencode.json`.

### Using OpenCode’s Built-in Providers

If you prefer to use OpenCode’s standard providers (Anthropic, OpenAI, Google, etc.) with your own API keys instead of Gradient, skip the setup wizard by pressing Enter, then use the `/connect` command inside OpenCode to add your API keys for any of 75+ supported providers.

## Updating

To update OpenCode to the latest version:

```
/opt/update-opencode.sh
```

## Troubleshooting

### OpenCode not found in PATH

Ensure you’re in a login shell (SSH session) where PATH is set. Or run directly:

```
/root/.opencode/bin/opencode
```

### AI features not working

Re-run the setup wizard to reconfigure your Gradient model access key:

```
/opt/setup-opencode.sh
```

Or manually edit `/root/.local/share/opencode/auth.json` — set `digitalocean` to `{"type": "api", "key": "<your key>"}`. Create keys at [https://cloud.digitalocean.com/gen-ai/model-access-keys](https://cloud.digitalocean.com/gen-ai/model-access-keys).

## Additional Resources

- **Documentation**: [https://opencode.ai/docs](https://opencode.ai/docs)
- **CLI Reference**: [https://opencode.ai/docs/cli/](https://opencode.ai/docs/cli/)
- **GitHub**: [https://github.com/anomalyco/opencode](https://github.com/anomalyco/opencode)

## Support

For OpenCode-specific issues:

- Documentation: [https://opencode.ai/docs](https://opencode.ai/docs)
- GitHub: [https://github.com/anomalyco/opencode](https://github.com/anomalyco/opencode)

For DigitalOcean Droplet issues:

- DigitalOcean Support: [https://www.digitalocean.com/support](https://www.digitalocean.com/support)
- Community Tutorials: [https://www.digitalocean.com/community](https://www.digitalocean.com/community)

* * *

**Note**: This 1-Click installs OpenCode via the official install script and pre-configures DigitalOcean Gradient AI as the inference provider. SSH is the only exposed port; there is no web interface. Commercial models (Anthropic Claude, OpenAI GPT) are also available through Gradient but require their respective provider API keys configured in the DigitalOcean console.