You can run OpenCode on your phone today. Fastest path: install
Cosyra for iOS or
Cosyra for Android, sign in, and type
opencode in the terminal. We pre-install OpenCode in an Ubuntu 24.04
x86_64 container alongside Claude Code, Codex CLI, and Gemini CLI, so none of
the Termux misdetection failures apply. Sign up gets you 1 hour of free compute,
no credit card; opt into a 10-hour, 7-day trial when you want more.
This guide was written by the Cosyra team. We tested OpenCode on iPhone and Android via Cosyra in April 2026, and re-ran the install and Termux setup against OpenCode 1.15.13 on 2026-06-04 to confirm what is still broken. Those hands-on behavior notes stay dated 2026-06-04. We re-verified the volatile facts (version, star count, and the Termux issue states) on 2026-07-16 against the anomalyco/opencode repo and the official docs: the container tracks releases and now ships OpenCode 1.18.2, and the misdetection is still unfixed. Issue #21043 was auto-closed as not-planned on 2026-07-03 by GitHub's 60-day staleness bot, not by a fix, so the Termux behavior is unchanged.
What is OpenCode?
OpenCode is the open-source AI coding agent maintained by Anomaly (the
project moved from sst/opencode to
anomalyco/opencode; GitHub still redirects the old URL). It
ships under MIT, with about 186,000 stars on GitHub as of 2026-07-16. The
codebase is mostly TypeScript with a small Rust component, distributed as
prebuilt binaries via npm optionalDependencies, one binary per
platform and arch combination.
The pitch versus the closed agents is the license, the lack of vendor
lock-in, and the headless server mode. OpenCode brokers Anthropic, OpenAI,
Google, and local models behind a single TUI; opencode serve
starts a headless HTTP server you can drive from an IDE plugin, a script, or (relevant
here) a phone. The README explicitly notes you can run the server "on your computer
while you drive it remotely."
How can you run OpenCode on a phone?
You can run OpenCode on a phone three ways: a cloud Ubuntu container with
OpenCode pre-installed reached from a native mobile app (Cosyra), Termux on
Android via the proot-distro workaround, or Blink Shell on iOS into a VPS
where you install opencode yourself. OpenCode needs a real Linux or macOS
shell with the right binary for the right arch, so every approach puts the
actual opencode process somewhere else and gives your phone a way
to drive it. All three are current as of 2026-07-16.
1. Cosyra: cloud Ubuntu container, OpenCode pre-installed
This is what we built. A native iOS and Android terminal that connects to a
persistent Ubuntu 24.04 x86_64 container in the cloud. OpenCode, Claude
Code, Codex CLI, and Gemini CLI are already on the image against a current
Node 20+. You sign in, run opencode auth to connect your provider
once, and type opencode.
- Works when: you want zero setup, both iOS and Android from
the same container, and you do not want to debug npm
optionalDependenciesresolution on your phone. - Breaks when: you have no internet (the container lives in the cloud), or you need to reach a private network we do not route through. Honest trade-off list in Cosyra vs Termux.
- Cost: 1 hour free on signup, no credit card. Extend with a 10-hour, 7-day trial when you want more, then $29.99/month. You pay your provider for OpenCode tokens; OpenCode itself is free. See pricing.
2. Termux on Android, via proot-distro
Install Termux from F-Droid (the Play Store build returned in June 2024 as a
separately-versioned Android 11+ build, but most install guides target
F-Droid), then install proot-distro and run a Debian or Ubuntu chroot
inside Termux. If you want the full rundown of this chroot path versus UserLAnd
versus a cloud x86_64 container, see Linux Container on Android: 3 Real Options in 2026. Inside that chroot, install Node 20+ and
npm i -g opencode-ai. Why the chroot? Issue #21043 (auto-closed
as not-planned 2026-07-03, not fixed) says the launcher misdetects the
Termux environment as plain Linux and pulls the wrong arch binary; PR
#21106, which would have removed the hard-exit, was closed without merging.
Feature request #22805 asking for native Termux support was closed without a
maintainer commitment. We walk through this Android-specific path, including
the exact proot-distro commands and why the misdetection happens, in
our guide to running OpenCode on Android.
- Works when: you are on Android, you accept the proot-distro overhead, and you want a fully local setup with no cloud bill.
- Breaks when: a new OpenCode release ships changes that break the chroot path, or Android 12+'s phantom process killer terminates a long agent run. The misdetection bug is the headline; the PR that would have fixed it (#21106) was closed without merging, so it never landed.
- Cost: free OpenCode binary, free Termux, free proot-distro. The cost is your time when the install path breaks between releases.
Worth knowing why this is an OpenCode problem specifically rather than a
Termux one: OpenCode compiles to a per-platform binary, so the launcher has
to pick the right arch and sometimes picks wrong. Agents that stay pure
TypeScript never face that choice. Pi
is the clearest example. Its npm package declares no os and no
cpu constraint (verified against the registry 2026-07-20), so Termux's
aarch64 Node runs it without a chroot. If the proot-distro overhead above is what
is putting you off, a Node-only agent is the shorter path.
3. SSH from Blink Shell into your own VPS (iOS only)
On iPhone or iPad, Blink Shell is the gold-standard
SSH client. Spin up a VPS (Hetzner, Scaleway, DigitalOcean), npm i -g opencode-ai on it, SSH in from Blink inside a tmux session, and run opencode. Authenticate with
opencode auth or by exporting your provider key. You can also point
Blink at opencode serve over a tunnel if you prefer the HTTP API
to the TUI.
- Works when: you want a box that is yours and an iOS-native keyboard. Polished terminal UX on iPhone.
- Breaks when: you do not want to be a sysadmin. Patching, hardening, firewall rules, and backups are not optional on a box that holds your source code and your provider keys.
- Cost: Blink Shell is $19.99/year, the VPS is $5 to $40/month. No Android equivalent; Blink is iOS-only. Trade-off detail in Blink Shell alternative: Cosyra for iPhone terminals.
How do you set up OpenCode on iPhone or Android?
You set up OpenCode on iPhone or Android in about three minutes with Cosyra:
install the app, sign in, confirm opencode is on the PATH, run opencode auth to connect a provider, clone a repo, run opencode. No Node
install, no npm, no Termux misdetection.
Step 1: Install Cosyra and sign in
Download from the App Store or Google Play. Sign in with Apple, Google, or email. On first launch we provision a fresh Ubuntu 24.04 x86_64 container, about 15 seconds in our testing.
Install Cosyra to follow along. OpenCode, Claude Code, Codex CLI, and Gemini CLI are already in the image, so the rest of this walkthrough is configuration, not installation.
1 hour free. No credit card. No trial signup. Pricing details.
Welcome to Cosyra.
Ubuntu 24.04.1 LTS (x86_64)
Pre-installed: claude, codex, gemini, opencode
$ node --version
v20.18.1
Step 2: Confirm OpenCode is there
No install step. OpenCode is baked into the image. Verify in one command.
$ opencode --version
1.18.2
$ which opencode
/usr/local/bin/opencode
Step 3: Connect a provider
Run opencode auth and pick the provider you want. Anthropic, OpenAI,
Google, and local backends are all in the list. The flow opens a URL; sign in
on your phone browser, paste the verification code back into the terminal. Keys
persist with your container's home volume, so you do this once per provider per
container.
$ opencode auth
Select provider:
> anthropic
openai
local
Open https://opencode.ai/auth/... on your phone
Code: ****-****
Connected: anthropic
Step 4 (optional): Use an env-var key instead
If you would rather not run the auth flow, export a provider key directly.
OpenCode reads ANTHROPIC_API_KEY,
OPENAI_API_KEY, and similar.
$ echo 'export ANTHROPIC_API_KEY="sk-ant-..."' >> ~/.bashrc
$ source ~/.bashrc
$ echo ${ANTHROPIC_API_KEY:0:8}...
sk-ant-a...
Step 5: Run your first OpenCode session
$ git clone https://github.com/your-org/your-project.git && cd your-project
$ opencode
opencode 1.18.2
workspace: /home/cosyra/your-project
agent: build (default, edit access)
> Read the README and propose three small
refactors. Show diffs before applying.
OpenCode reads the repo, proposes diffs, and waits for your approval before writing. The default build agent has edit access; the plan agent is read-only if you want to think before touching code. Both ship in the box.
Try it free. 1 hour on signup, no credit card. OpenCode and three other agents pre-installed. App Store / Google Play / Pricing details
What does an OpenCode session on a phone look like?
OpenCode's specific phone unlock is the multi-provider switch on a flag (--model anthropic/claude-3.7 vs
--model openai/gpt-5) plus the headless server mode. It also
loads MCP servers from config (opencode.ai/docs/mcp-servers),
and the persistence problem there is the same one we hit with any agent on
mobile: a phone OS kills background processes, so a local stdio server dies
the moment you switch apps. The container keeps it running server-side. See
running MCP servers from your phone.
Three real sessions we run from a phone.
Compare two providers on the same task, on the train
You have a tricky bug. Open Cosyra,
cd in, opencode --model anthropic/claude-sonnet-4-6, paste the failing test plus the suspect file, ask for a root-cause. New
session: opencode --model openai/gpt-5, same prompt. Cross-
check the answers. The unification under one CLI is what makes that fast.
Drive `opencode serve` from Blink on a VPS
On iOS, the Blink-plus-VPS path lets you run
opencode serve headless and hit it from a separate Blink pane via
the HTTP API. Useful when you want a long-running session that survives SSH reconnects.
We do not host the serve mode for you on Cosyra; that is squarely a Blink+VPS
workflow.
Read-only repo audit from the couch
Saturday, you are curious about a repo a coworker shipped Friday.
opencode --agent plan launches the read-only plan agent. Ask it to
summarize the repo, list the riskiest files, and propose what you would change.
No write access, no accidental edits.
What are the real limits of running OpenCode on a phone?
The real limits are no offline mode, the Termux path is rough,
opencode serve is on you to host, and your provider's rate limits
still apply. Knowing where OpenCode stops helps you match it to the right job.
- No offline mode. The container and your provider both live in the cloud. No internet, no OpenCode. If you code on planes with no wifi, this is not the right tool for that slot.
- Termux is rough today. The launcher misdetects Termux as Linux (issue #21043, auto-closed as not-planned on 2026-07-03 for inactivity, still unfixed). The native-Termux feature request (#22805) was closed without a commitment. PR #21106 to remove the hard-exit was closed without merging. proot-distro works but is not pleasant.
- You host `opencode serve` yourself. The headless server mode is great, but Cosyra runs the TUI in your container, not the HTTP API on a public address. If you want the API, run it inside your container and reach it via the same Cosyra session.
- Provider rate limits are yours. OpenCode is just the agent; the rate-limit and billing relationship is between you and Anthropic / OpenAI / Google. We do not proxy or meter that.
- No Docker-in-Docker guarantee. If your project's tests need
dockeron the host, verify before committing to phone-only.
How does Cosyra compare to Termux+proot and Blink+VPS for OpenCode?
Cosyra wins for zero-setup, dual-platform, and skipping the Termux
misdetection bug; Termux-plus-proot wins if you want a fully local setup and
accept the chroot overhead; Blink-plus-VPS wins on iOS if you want a box you
own and you want to run opencode serve. None is strictly best;
each maps to a trade-off. Comparison as of 2026-07-16.
| Feature | Cosyra | Termux + proot-distro | Blink + VPS |
|---|---|---|---|
| OpenCode pre-installed | Yes | No (chroot install) | You install on VPS |
| Platforms | iOS + Android | Android only | iOS only |
| Termux misdetection (#21043) avoided | Yes (x86_64 Ubuntu) | Yes (chroot is real Linux) | Yes |
| OpenCode license | MIT (same binary) | MIT | MIT |
| Run `opencode serve` exposed publicly | No (internal only) | No (local only) | Yes (your VPS) |
| Setup time (cold) | ~3 min | 30–60 min | 30 to 60 min |
| Price (not counting tokens) | 1h free, then $29.99/mo | Free | $19.99/yr + VPS (~$5–40/mo) |
On an iPhone specifically, where iOS has no Termux and the on-device
terminals cannot run modern Node, our
OpenCode on iPhone guide breaks
down the three host paths in detail. On a bigger screen with a Magic Keyboard,
the iPad-specific version of this walkthrough is
OpenCode on iPad, which covers
Split View, Stage Manager, and the opencode web browser path. For
the broader picture across all four AI agents on mobile, see our pillar guide
on
AI coding agents on mobile. Same walkthrough with Anthropic's tool:
Claude Code on phone (and for
a direct OpenCode vs Claude Code decision, MIT vs custom license, multi-provider
vs Anthropic-tuned surface, see
Claude Code vs OpenCode on phone); OpenAI's: Codex CLI on phone; Google's: Gemini CLI on phone. For another open-source option, Alibaba's agent, forked from Gemini CLI,
see Qwen Code on your phone.
And if you want the tool that defined the open-source pair-programming
workflow before the agent wave, see
Aider on your phone, or weigh it
against a cloud terminal head-to-head in
Cosyra vs Aider. Every option
above is BYOK or open source; for the opposite end of that spectrum, a
proprietary, credit-billed agent where you buy credits and it routes the
model rather than bringing your own key, see
running Amp's CLI from your phone. For an open-source terminal agent whose story just changed, see
Continue's cn CLI on phone.
Continue was acquired by Cursor in mid-June 2026 and its main branch stopped
(last commit 2026-06-19), but the Apache-2.0 cn binary still installs
and runs on the keys you bring, which is exactly the kind of BYOK CLI a cloud
container keeps alive. If Continue's freeze is what sent you shopping, we lined
up the
Continue.dev alternatives that still work
and OpenCode is one of the three we would actually reach for. Two newer agents
you install yourself trip people up on mobile in opposite ways: see
Cline on phone, the 62.9k-star
agent with no mobile app at all, and
goose on phone, whose free iOS app
is a remote control rather than an on-device agent. For Charm's terminal
agent specifically, which ships no app and installs in one command, see
Crush on your phone. Anysphere's
terminal agent breaks the npm pattern the rest of this list shares: it lands
as a native binary from a curl installer and bills through a Cursor
subscription rather than a provider key you bring, which is why we gave it
its own walkthrough in
Cursor CLI on your phone.
Forge takes that same native-binary path in Rust: its npm wrapper just
downloads the right prebuilt binary for your architecture, including an
aarch64-linux-android build that runs under Termux, so it installs
without the glibc misdetection that trips OpenCode; see
Forge CLI on your phone. The
closest cousin to OpenCode here is Kilo CLI. It is built on OpenCode itself,
so the runtime shape is the same one we run in production; see
Kilo CLI on your phone, or the
head-to-head in
Cosyra vs Kilo Code. Two more
agents sit at the edges of this list. Codebuff is open source (Apache-2.0
per the repo LICENSE file) and installs the same way OpenCode does,
npm install -g codebuff, but it bills in credits at 1¢ each
while still letting you bring an OpenRouter key, a hybrid none of the agents
above use; see
Codebuff on your phone. Plandex
breaks the pattern harder: it is the one client-server agent here, so the
plandex binary is useless without a server you self-host with Docker
Compose and PostgreSQL, and as of 2026-07-18 its
plandex.ai domain no longer resolves, which kills the documented
install command. The pinned GitHub release still works, and we walk through both
halves in
Plandex on your phone.
Frequently asked questions
Can you run OpenCode on a phone?
Yes, indirectly. OpenCode wants a real Linux or macOS shell with the right binary for the right arch. The three working paths are a cloud Ubuntu container reached from a native mobile app (Cosyra), Termux on Android via proot-distro, or Blink Shell on iOS into a VPS where you install opencode yourself. The README on github.com/anomalyco/opencode lists macOS, Linux, and Windows; there is no iOS or Android build.
[source: GitHub, anomalyco/opencode README]
Is OpenCode the same project as sst/opencode?
Yes. The repo moved from the SST organization to Anomaly (anomalyco on
GitHub); GitHub redirects the old sst/opencode URL. The lead maintainer
(@thdxr) is the same person who built it under SST. The npm package name remains
opencode-ai.
[source: GitHub, anomalyco/opencode]
Why doesn't OpenCode install cleanly on Termux?
Issue #21043 (opened 2026-04-04, auto-closed as not-planned on 2026-07-03
for inactivity, not fixed) reports that the launcher misdetects Termux as
plain Linux and tries to run the Linux-x64 binary on Android-arm64,
leading to "incompatible binary" failures. PR #21106, which would have
removed the hard-exit, was closed without merging, so there is no landed
fix. The earlier postinstall failure (#12515) was fixed when an
opencode-android-arm64 binary was added to optionalDependencies, but the misdetection means the upstream installer still needs a
proot-distro chroot. The third-party
guysoft/opencode-termux project sidesteps it a different way, cross-compiling
OpenCode and Bun to Android aarch64 so it runs natively in Termux; its v0.2.1
release (2026-06-25) packages OpenCode 1.17.9, behind upstream 1.18.3.
[source: GitHub, anomalyco/opencode issue #21043]
Did Anomaly commit to native Termux support?
No. Feature request #22805, "[FEATURE]: Termux native support," was opened
2026-04-16 and closed without a maintainer commitment to land it. The
requester explicitly noted that Claude Code and Gemini CLI both work on
Termux while OpenCode requires the proot-distro workaround. PR #21106,
which would have removed the hard-exit, was later closed without merging,
so upstream still has no native Termux path. If native Termux matters to
you, the community filled the gap out-of-tree:
guysoft/opencode-termux ships a native aarch64 build (v0.2.1, 2026-06-25,
OpenCode 1.17.9) as a pacman package, deb, or standalone zip.
[source: GitHub, anomalyco/opencode issue #22805] [source: GitHub, guysoft/opencode-termux release v0.2.1]
What does `opencode serve` do?
opencode serve starts a headless OpenCode server with an HTTP API,
documented under the CLI docs at opencode.ai/docs/cli/. It is the right entrypoint
for IDE plugins, scripts, CI, and remote drivers. The README explicitly says
you can run the server on one machine and drive it from another. Cosyra runs
the TUI inside your container; if you want the HTTP API exposed publicly, the
Blink-plus-VPS path is currently a better fit.
[source: opencode.ai, CLI docs]
How do I install OpenCode without npm?
The official install script is curl -fsSL https://opencode.ai/install | bash, which detects your platform and arch and pulls the right prebuilt
binary. Homebrew (brew install anomalyco/tap/opencode),
Scoop, Chocolatey, Pacman, AUR, mise, and Nix are all in the README. On
Cosyra you do not see this step; OpenCode is on the image already, sourced
from the same prebuilts.
tl;dr
OpenCode runs on Linux or macOS with the right arch binary, not on phones directly. Three bridges: a cloud Ubuntu container with OpenCode pre-installed (Cosyra), Termux on Android via proot-distro, or Blink Shell on iOS into a VPS. We recommend the cloud container for most people because the Termux launcher still misdetects the environment and the native-Termux feature request was closed without commitment.
App Store / Google Play. 1 hour free on signup. No credit card.
Run OpenCode from your phone in three minutes.
Install Cosyra, sign in, run opencode auth, type
opencode.