You can run OpenCode on iPhone today, but not on the phone itself. OpenCode
ships prebuilt binaries for macOS, Linux, and Windows, and iOS gives you
none of those — there is no Termux for iPhone, and the local terminals that
do exist cannot run a modern Node.js. So on an iPhone the agent always runs
on a host elsewhere and your phone drives it. The fastest path is
Cosyra on the App Store: a cloud Ubuntu 24.04
container with OpenCode pre-installed that you reach from a native iOS app.
Connect a provider, type opencode, and you are in the TUI. Sign
up gets you 1 hour free, no credit card. The two other real paths are SSH
from
Blink Shell into your own Linux box, and OpenCode's
own opencode serve headless server reached over a private network.
This is the iPhone-specific companion to our
OpenCode on your phone
walkthrough, which covers iPhone and Android together. The iPhone earns its own
page because iOS changes the answer in one big way: Android has Termux, so on
a Pixel or Galaxy you can fall back to a proot-distro chroot to get
closer to the metal (we cover that in
OpenCode on Android). iOS has
no equivalent. That single difference is why the iPhone story is all about
reaching a host, never about running OpenCode on the device. If you want the
bigger tablet form factor, see
OpenCode on iPad; for the full
picture of every agent on mobile, start at our
AI coding agents on mobile
pillar.
Quick decision. Jump to what matches your situation:
- Just give me the setup. Three-minute path: install Cosyra,
connect a provider, type
opencode. Cosyra iPhone setup ↓ - My dev box is Linux. SSH in from Blink Shell, or skip the host with a cloud container. Three options compared ↓
- I want OpenCode's own remote, for free. Run
opencode serveon a machine you own. Three options compared ↓ - Why can't I just use iSH like on a Linux box? Because modern Node crashes under iSH's i386 emulation. Why nothing runs locally ↓
Why won't OpenCode run locally on an iPhone?
OpenCode will not run locally on an iPhone because iOS has no Linux userland
and the on-device terminals cannot run a modern Node.js. OpenCode is
distributed as a Node package (opencode-ai) plus a
platform-matched prebuilt binary, and the README lists its targets as macOS,
Linux, and Windows. iOS is not one of them, and Apple does not allow a
Termux-style app that ships a general-purpose Linux environment with a
package manager. So the two well-known iOS terminals each hit a wall:
- iSH emulates 32-bit i386 Alpine Linux. Modern Node.js crashes
with
Illegal instructionunder that emulation — tracked in iSH issue #2335, open since 2024-01-21 — and the i386-only target rules out OpenCode's prebuilt binaries anyway. No working Node means no OpenCode. - a-Shell ships native iOS-compiled tools and a curated set of
WebAssembly binaries. It is genuinely useful, but it has no
apt, noapk, and no global npm install path, so there is nowhere to put OpenCode.
Here is an opinion the "just self-host it" crowd pushes back on: keeping a
machine awake at home so your phone has something to talk to is the exact
chore that mobile coding is supposed to remove. OpenCode's
opencode serve is a genuinely good design, and we link the docs below,
but a server you babysit is still a server you babysit. When the home box sleeps
on the train, the phone has nothing. We pre-install OpenCode in a cloud container
precisely so there is no second computer in the loop. For the local-terminal limits
in more depth see
Termux for iPhone and
Cosyra vs iSH.
What are the three ways to run OpenCode on iPhone?
There are three real ways to run OpenCode from an iPhone as of 2026-06-30: a
cloud terminal with OpenCode pre-installed (Cosyra, native iOS app), SSH
from a terminal app into your own always-on Linux box, or OpenCode's own
headless
opencode serve on a machine you own, reached over a private network.
All three share the same shape: the agent runs on a host and the iPhone is the
remote. They differ in who owns and babysits that host.
1. Cosyra (cloud terminal, native iOS app)
This is what we build. The Cosyra iOS app gives you a persistent Ubuntu 24.04 container with OpenCode, Claude Code, Codex CLI, and Gemini CLI already installed, 30 GB of storage, and hibernation that resumes exactly where you left off. We pre-install the four agents because setup friction is the thing that actually kills agent-driven mobile coding; nobody wants to debug a curl installer or a Node version on a phone keyboard. There is no SSH tunnel to keep alive and no laptop that has to stay awake. The same container is reachable from iPhone, Android, and web, so you can start on the couch and pick it up in a waiting room.
- Works when: you want zero setup and a host you do not have to maintain, and you want the real OpenCode TUI rather than a remote view of it.
- Breaks when: you have no internet — the container lives in the cloud, so there is no offline mode. That is a real trade-off against a local terminal.
- Cost: 1 hour free on signup, no credit card. Extend with a 10-hour, 7-day trial when you want more. After that, $29.99/month or $300/year. OpenCode is free and MIT-licensed; you bring your own model-provider key and pay the provider directly. See pricing.
2. SSH from Blink Shell into your own machine
The classic remote-into-your-own-box path.
Blink Shell is a paid iOS terminal built around
SSH and Mosh. Mosh matters on a phone: it keeps the session alive across the cellular
handoffs and IP changes that drop plain SSH the moment you walk between cell towers.
You SSH into a Linux box or VPS where you installed OpenCode with npm i -g opencode-ai@latest or the
curl -fsSL https://opencode.ai/install | bash script, start
tmux so the TUI survives app switching, and drive it from there.
- Works when: you already keep an always-on machine and are comfortable with SSH plus tmux.
- Breaks when: the machine sleeps, the home connection drops, or you do not want to keep a second computer awake just to give the phone a target.
- Cost: the Blink+ subscription plus whatever the host costs. Tailscale's free tier covers the personal networking.
3. opencode serve / opencode web on your own host
This is OpenCode's own remote-friendly design, and it is the one genuinely
distinctive path here.
opencode serve
runs a headless HTTP server (default port 4096, default hostname
127.0.0.1), and opencode web starts a browser UI you
can open in Safari. Because the default binds to localhost, the safe way to reach
it from a phone is over a private network rather than the public internet: put
the host on a Tailscale
tailnet, run the server, and set OPENCODE_SERVER_PASSWORD so it is
not wide open. Then the iPhone hits the web UI or the API directly.
- Works when: you run a free, open-source agent on hardware you control and are comfortable with the networking setup.
- Breaks when: the host sleeps, or you do not want to expose and secure a server just so the phone has a target. The default localhost bind means anything wider is your responsibility to lock down.
- Cost: free software (MIT) plus the host and your model-provider tokens. This is the cheapest path if you already run an always-on box.
How do you set up OpenCode on iPhone with Cosyra?
You set up OpenCode on iPhone in about three minutes: install Cosyra from
the App Store, connect a model provider inside the container, and type
opencode. No Node install, no SSH tunnel, no jailbreak. These
are the exact steps we run on a fresh iPhone.
Step 1: Install Cosyra on iPhone
Open the App Store on your iPhone and search for Cosyra. Sign in with Apple, Google, or email and the app provisions a fresh Ubuntu container on first launch, about 15 seconds in our testing. The four agent CLIs are already inside, so you skip the part that breaks most on-phone setups.
Step 2: Connect a model provider
OpenCode is provider-agnostic, so the one setup step is authenticating a
backend. Start opencode and connect Anthropic, OpenAI, Google, or
a local model:
$ opencode --version
opencode 1.17.11
$ opencode
Use /connect to authenticate a provider
› /connect anthropic
Opened opencode.ai/auth — paste the code to finish.
The credentials persist with the container's home volume, so you connect once and they are there next time. OpenCode itself is free; the provider bills you for tokens.
Step 3: Clone a repo and run opencode
Clone a repo and start the TUI:
$ git clone https://github.com/your-org/your-project.git
Cloning into 'your-project'...
$ cd your-project
$ opencode
OpenCode 1.17.11 — build agent (edit access)
Type a prompt, or /plan for read-only analysis.
› Find the bug in the checkout flow and write a failing test first.
OpenCode reads the repo and starts working. The two built-in agents matter
on a phone: build has edit access for changes, and
plan is read-only for when you just want analysis without the agent
touching files. When you close the app to catch your stop, the container hibernates;
reopen it and the session is exactly where you left it, with no re-clone and no
re-auth.
Try it free. 1 hour on signup, no credit card. Extend with a 10-hour, 7-day trial when you want more. App Store / Google Play / Pricing details
What does iPhone OpenCode look like in practice?
iPhone OpenCode in practice is short prompts, one hand, and dead time that used to be wasted. The phone is not where you do a four-hour refactor; it is where you keep a long task moving while you are away from the desk. Two patterns we run constantly:
The commute kickoff
Standing on the platform, you remember the failing CI job from last night. Open Cosyra, pull the branch, and hand OpenCode the whole problem in one dictated sentence — press and hold the mic key, say it, release:
$ git fetch origin && git checkout fix/ci-flake
$ opencode
› The auth integration test is flaky in CI. Reproduce it,
find the race, and propose a fix with a regression test.
By the time the train arrives you have a diff to skim. Because OpenCode is
provider-agnostic, you can switch the model on the fly with
--model if the cheap model stalls on the hard part — useful when
you are watching token spend on a personal key.
The waiting-room review
Fifteen minutes in a waiting room is enough to review a teammate's pull
request. Pull the branch, drop into OpenCode's plan agent so it reads
without editing, ask for a structured review of what you care about, and post
it with gh pr review --comment from the same terminal. The container
holds your gh auth, so there is no login dance. This is the kind of work the phone
is genuinely good at: bounded, reviewable, no deep window juggling required. We
think the on-screen keyboard is fine for this — the work is prompts and approvals,
not hand-typing functions, and most people who say otherwise have not tried it
on a real commute.
How do the iPhone options compare?
The three paths line up cleanly against what matters for an agent client: whether you maintain the host, whether you get the real CLI, and what happens when you switch apps or lose signal. The table covers the real options as of 2026-06-30. For the wider field of editors and terminals beyond OpenCode, our coding on iPhone guide lines every option up the same way, and best terminal apps for iPhone covers the client side.
| Feature | Cosyra (iOS app) | SSH via Blink Shell | opencode serve / web |
|---|---|---|---|
| Gives you the real OpenCode | Yes (cloud host) | Yes (your host) | Yes (your host) |
| OpenCode pre-installed | Yes | You install on host | You install on host |
| Requires another machine | No | Yes (always-on) | Yes (always-on) |
| Interface on the phone | Full TUI | Full TUI | Web UI / API |
| Persistent workspace | Yes (30 GB) | On your host | On your host |
| Setup time | ~3 min | 15–30 min | 20–40 min |
| Cost on iPhone | $29.99/mo after trial | Blink+ sub + host | Free software + host |
Which path should you pick?
Choose Cosyra if you want the real OpenCode TUI with no host to maintain and
the same container across iPhone, Android, and web — and the other three
agents next to it. Choose Blink plus SSH if your dev box is already
always-on and Linux, and you want OpenCode running on hardware you control.
Choose
opencode serve if you want to lean into OpenCode's open-source, self-hosted
design for free and do not mind the networking setup. It is the honest pick for
anyone who values MIT-licensed software on their own box over convenience. The
one combination iOS cannot give you is OpenCode running on the phone itself; on
Android the calculus shifts because Termux gets you closer to local, which is
the whole point of our
OpenCode on Android guide.
Frequently asked questions
Can you run OpenCode directly on an iPhone?
Not on the device itself. OpenCode ships prebuilt binaries for macOS,
Linux, and Windows; there is no iOS build and no Termux for iPhone, so iOS
gives you no Linux userland and no modern Node to install it into.
OpenCode always runs on a host elsewhere and the iPhone drives it: a cloud
Ubuntu container with OpenCode pre-installed (Cosyra), SSH into your own
Linux box, or
opencode serve on a machine you own.
[source: OpenCode README, supported platforms macOS/Linux/Windows]
Does OpenCode have an iPhone app or a mobile remote like Codex?
No. OpenCode is a CLI and TUI with no native mobile app, and unlike
OpenAI's Codex or GitHub Copilot CLI it has no first-party phone
remote-control surface. What it does have is a headless server: opencode serve
exposes an HTTP API and opencode web starts a browser UI, both
self-hosted. The closest thing to an official remote route is running that server
on a machine you own and reaching it from the phone.
[source: OpenCode docs, server / opencode serve and opencode web]
Why can't iSH or a-Shell run OpenCode on iPhone?
Both are real on-device terminals, but neither runs a modern Node.js, and
OpenCode's installers expect a real Node plus a platform-matched binary.
iSH emulates 32-bit i386 Alpine Linux and current Node crashes there with
Illegal instruction. a-Shell ships curated native and
WebAssembly tools with no apt, no apk, and no
global npm install path. Fine for shell scripting on the go; not a path to
OpenCode.
[source: iSH GitHub issue #2335, Node "Illegal instruction"]
Can I run opencode serve on my own machine and use it from my iPhone?
Yes, and this is OpenCode's own remote-friendly design.
opencode serve runs a headless HTTP server (default port 4096,
default hostname 127.0.0.1); opencode web starts a
browser UI. To reach it from a phone, bind it to your private network rather
than the public internet — a Tailscale tailnet is the clean way — and set
OPENCODE_SERVER_PASSWORD so it is not open. You are still keeping
a machine awake for the phone to talk to.
[source: OpenCode docs, server flags and OPENCODE_SERVER_PASSWORD]
Is OpenCode free to run from an iPhone?
The OpenCode agent itself is free and MIT-licensed; you pay your model
provider directly for tokens. So the SSH and opencode serve
paths cost only the host plus model usage. Cosyra is the paid convenience layer
— the container, the four pre-installed agents, and the native iOS app — starting
after the free tier. You bring your own provider key on Cosyra too.
[source: OpenCode README, MIT license and provider-pays model]
What terminal app is best for SSHing into an OpenCode host from iPhone?
A native SSH/Mosh client like Blink Shell holds a session better than a
web terminal, because Mosh survives the cellular handoffs that drop plain
SSH when you walk between cell towers. Start tmux on the host so
the OpenCode TUI survives app switching. SSH still needs a machine on the other
end, and a cloud container removes both the SSH client and the host you would
otherwise maintain.
[source: Hacker News, "Show HN: Echo, an iOS SSH+mosh client"]
tl;dr
OpenCode does not run locally on an iPhone — iOS has no Termux and the
on-device terminals cannot run modern Node. Three real ways to reach it as
of 2026-06-30: Cosyra (cloud terminal, native iOS app, OpenCode
pre-installed, persistent container, no other machine required), SSH from
Blink Shell into your own Linux box, or OpenCode's own opencode serve headless server on a machine you keep awake, reached over Tailscale. The phone
is the remote; the host does the work.
App Store / Google Play. Sign up — 1 hour free, no credit card. Extend with a 10-hour, 7-day trial when you want more.
Run OpenCode from your iPhone in 3 minutes.
Install Cosyra, connect a provider, type opencode.