Introduction
If you’ve been utilizing Claude Code to get AI assistance straight successful your terminal, you already cognize really powerful the acquisition is. You picture a task, and an supplier sounds your files, edits code, runs commands, and reports back, each without leaving the bid line. The only existent downside from Claude Code is that it is built for Anthropic’s models. Its pricing is tied to an Anthropic subscription, and your codification passes done Anthropic’s infrastructure.
OpenCode is the open-source reply to that. It delivers the aforesaid terminal-native, agentic coding experience, including record editing, ammunition commands, Language Server Protocol (LSP) integration, and multi-session support, but you’re successful power of the exemplary and the infrastructure. In this tutorial, you’ll deploy OpenCode connected a DigitalOcean Droplet utilizing the 1-Click Marketplace App, pre-configured for Serverless Inference, pinch nary section instal and nary configuration files to hand-write.
Key Takeaways
- OpenCode is an open-source, terminal-based AI coding supplier pinch complete 163,000 GitHub stars and 7.5 cardinal monthly users, built arsenic a drop-in replacement for devices for illustration Claude Code.
- DigitalOcean offers a 1-Click Application that deploys OpenCode connected a Droplet, pre-configured pinch DigitalOcean Serverless Inference, pinch nary section instal required.
- The Droplet comes pinch entree to MiniMax M2.5, Claude Sonnet 4.5, GPT-5, DeepSeek, Llama 3.3, Kimi K2.5, and more, each via a azygous Gradient exemplary entree key.
- The full setup tin beryllium complete successful 5 minutes: deploy the Droplet, SSH in, paste your exemplary entree cardinal into the setup wizard, and commencement coding.
Why Is Claude Code Popular?
Claude Code brought a existent agentic loop moving wrong your terminal. Rather than copy-pasting codification suggestions from a chat window, Claude Code tin unfastened files, use edits, tally your trial suite, publication the output, and iterate, each autonomously. It understands your task astatine the LSP level, meaning it has entree to the aforesaid type of accusation your editor does.
For developers who unrecorded successful the terminal, this is simply a important quality-of-life upgrade. The entreaty is real, and the acquisition is genuinely good. But each statement of codification you manus it passes done their systems nether their information policies.
Why Use OpenCode + DigitalOcean Instead?
OpenCode replicates the Claude Code experience, including a terminal personification interface (TUI), record editing, ammunition commands, LSP awareness, and multi-session support, but removes the lock-in. Here are immoderate of the main benefits:
Model Freedom. You prime the model. Kimi K2.6, DeepSeek V4 Pro, Llama 4, Qwen 3 Coder, immoderate performs champion for your workload. You tin moreover move mid-project pinch a azygous /models command.
Open-Source and Auditable. OpenCode is MIT-licensed. You tin publication the code, fork it, and cognize precisely what it’s doing pinch your files and prompts.
Privacy-First by Design. OpenCode does not shop your codification aliases speech data. DigitalOcean Inference does not clasp aliases train connected punctual aliases consequence information beyond what’s required to supply the functionality.
Pay-Per-Token, Not Per Seat. Instead of a fixed monthly subscription, you salary for what you use. For developers who codification successful bursts, this is often importantly cheaper.
DigitalOcean arsenic the Backbone. DigitalOcean offers a 1-Click Application that deploys OpenCode connected a Droplet, pre-configured for serverless inference. SSH in, paste your exemplary entree key, and it’s ready. No section install, nary configuration files to hand-write.
Model Flexibility from Day One. The 1-Click app defaults to MiniMax M2.5, a tin general-purpose model, but the afloat Gradient catalog is disposable immediately: Kimi K2.5, Claude Sonnet 4.5, GPT-5.2, DeepSeek, Llama 3.3, Qwen3, and more. Switching is simply a azygous /models command.
How to Determine If This Is Right for You
Consider making the move if immoderate of these apply:
- You’re paying a monthly subscription for Claude Code, Cursor, aliases a akin instrumentality and want little aliases much predictable costs.
- You want to research pinch different models without switching tooling.
- You activity successful environments wherever sending codification to a circumstantial 3rd statement is simply a concern.
- You’re already a DigitalOcean customer and want to consolidate your AI walk there.
- You for illustration open-source package and want to understand what’s moving connected your machine.
Step 1 — Creating a Gradient Model Access Key
Log successful to the DigitalOcean Control Panel and connected the near broadside panel, navigate to Inference → Manage. Click Create Model Access Key, springiness it a sanction (e.g., opencode-droplet), and transcript the key. You won’t beryllium capable to position it again aft leaving the page.
This azygous cardinal gives you entree to the afloat catalog of Gradient models, including MiniMax M2.5, Kimi K2.5, Claude Sonnet 4.5, DeepSeek, Llama 3.3, and more, pinch nary abstracted API accounts required for each.
Step 2 — Deploying the OpenCode 1-Click Application
Go to the OpenCode listing successful the DigitalOcean Marketplace and click Deploy to DigitalOcean.
Choose a Droplet size. The minimum specs are 1 GB RAM / 1 vCPU / 25 GB storage, but 2 GB RAM / 2 vCPU aliases much is recommended for comfortable use:
| Minimum | 1 GB | 1 vCPU | 25 GB |
| Recommended | 2 GB | 2 vCPU | 50 GB |
Add aliases create an SSH cardinal for unafraid access, past click Create Droplet. The Droplet is fresh successful nether a minute.
Alternatively, deploy via the API:
curl -X POST -H 'Content-Type: application/json' \ -H 'Authorization: Bearer '$TOKEN'' -d \ '{"name":"opencode-server","region":"sfo2","size":"s-2vcpu-4gb","image":"opencode"}' \ "https://api.digitalocean.com/v2/droplets"Step 3 — SSHing In and Completing the Setup Wizard
Once the Droplet is ready, SSH in:
ssh root@your-droplet-ipOn first login, the setup wizard runs automatically. When prompted, paste the Gradient exemplary entree cardinal you created successful Step One:
Output
Enter your DigitalOcean Gradient exemplary entree key: ▌The wizard verifies the cardinal and writes the OpenCode configuration automatically. No YAML editing required.
Step 4 — Running OpenCode and Choosing Your Model
Navigate to your task and motorboat OpenCode:
cd /path/to/your/project opencodeIf you don’t already person a task connected the Droplet, you tin create an quiet task directory aliases straight commencement OpenCode and person it create the folders for you.

The default exemplary is MiniMax M2.5 (digitalocean/minimax-m2.5). To position the afloat database of disposable models, aliases to move models, tally /models wrong the TUI.
Try a existent prompt:
Build a elemental Python FastAPI app pinch the following: - A GET /health endpoint that returns {"status": "ok", "timestamp": <current UTC time>} - A POST /shorten endpoint that takes a {"url": "..."} assemblage and returns a clone short codification (just md5 the url, return first 8 chars) - A requirements.txt pinch fastapi and uvicorn - A trial record utilizing pytest that tests some endpoints - A README.md explaining really to tally it Create each the files, past tally pip instal -r requirements.txt and pytest to confirm the tests pass.OpenCode sounds the applicable files, plans the changes, applies edits crossed the codebase, runs your tests, and reports back, the aforesaid loop you’d get from Claude Code, pinch a exemplary you chose, connected infrastructure you control.
Switch betwixt the build supplier (full record access) and scheme supplier (read-only analysis) astatine immoderate clip by pressing Tab.
Step 5 — Pinning Your Model and Adding Project Rules
To group a default exemplary permanently, edit the config connected the Droplet:
nano /root/.config/opencode/opencode.jsonUpdate the exemplary field:
/root/.config/opencode/opencode.json
{ "$schema": "https://opencode.ai/config.json", "model": "digitalocean/minimax-m2.5" }You tin besides adhd a RULES.md record successful your task directory to springiness the supplier opinionated instructions that persist crossed sessions:
# Project Rules - This is simply a Python 3.12 task utilizing FastAPI and PostgreSQL. - Always adhd type hints to usability signatures. - Never modify existing migration files. Create caller ones. - Run `pytest` earlier considering immoderate task complete.Helper scripts are pre-installed connected the Droplet for communal tasks:
| Check version | /opt/opencode-version.sh |
| Update to latest | /opt/update-opencode.sh |
| Re-run setup wizard | /opt/setup-opencode.sh |
FAQ
Is OpenCode arsenic tin arsenic Claude Code?
For astir mundane coding tasks, including refactoring, debugging, penning tests, and generating boilerplate, yes. The value of the acquisition depends heavy connected the exemplary you choose, which is precisely the point. You tin benchmark different models against your circumstantial codebase and tasks, and move freely.
What does this costs compared to Claude Code?
DigitalOcean Inference bills per token. Check the current pricing page for per-model rates. The Droplet itself costs a fewer dollars per period depending connected size. For reference, Claude Code usage is billed against your Anthropic API quota aliases bundled into a Pro/Max subscription starting astatine $20/month. Developers who codification successful bursts typically find per-token pricing cheaper, while dense regular users whitethorn find subscriptions much predictable. If you want Claude specifically, Gradient besides provides Claude Sonnet and Opus via the do-anthropic models listed successful Step Four.
Is my codification sent to DigitalOcean servers?
With the Droplet setup, your codification lives connected the Droplet itself, not your section machine. Prompts are sent from the Droplet to DigitalOcean Inference to make responses. DigitalOcean does not clasp punctual aliases consequence information aft the petition completes. For maximum privacy, restrict the Droplet to a virtual backstage cloud (VPC) and scope your exemplary entree key. Review DigitalOcean’s information privateness policy for afloat details.
Can I move models mid-project?
Yes. Run /models successful the TUI astatine immoderate clip to switch. Your speech history stays intact, and only the exemplary handling the adjacent petition changes.
Can I usage my ain Anthropic aliases OpenAI API keys alternatively of Gradient?
Yes. Skip the setup wizard by pressing Enter erstwhile prompted, past usage /connect wrong OpenCode to adhd your ain API keys for immoderate of 75+ supported providers. The 1-Click App is pre-configured for DigitalOcean Serverless Inference, but it doesn’t fastener you in.
What’s the quality betwixt serverless and dedicated conclusion connected DigitalOcean?
Serverless conclusion (what this tutorial uses) is shared, pay-per-token, and requires nary provisioning, making it perfect for individual developers and mini teams. Dedicated conclusion gives you a reserved GPU endpoint for accordant latency and throughput, suited for accumulation workloads aliases teams pinch precocious petition volumes.
Conclusion
OpenCode is simply a mature, well-supported open-source replacement to Claude Code that gives you the aforesaid terminal-native agentic coding acquisition without the vendor lock-in. The DigitalOcean 1-Click Application removes moreover the clash of installation. Deploy a Droplet, SSH in, paste a exemplary entree key, and you’re coding pinch Kimi K2.5, Claude Sonnet, aliases immoderate different DigitalOcean Serverless Inference exemplary successful nether 5 minutes.
The adjacent measurement is to deploy the Droplet and effort it connected a existent task successful your codebase. Start pinch the scheme supplier to explore, move to build erstwhile you’re fresh to make changes, and usage /models to research pinch different models until you find the 1 that fits your workflow best.
- OpenCode connected the DigitalOcean Marketplace
- OpenCode Documentation
- DigitalOcean Inference Overview
- Available Models for Serverless Inference
- Create and Manage Model Access Keys
This activity is licensed nether a Creative Commons Attribution-NonCommercial- ShareAlike 4.0 International License.
English (US) ·
Indonesian (ID) ·