Skip to content

// guides

OpenCode on iPhone: 3 Ways to Run It

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.

Diagram of three ways to run OpenCode on iPhone and where the agent actually executes. Path 1, Cosyra native iOS app: the real OpenCode TUI runs in a cloud Ubuntu 24.04 container, pre-installed, no machine to maintain. Path 2, Blink Shell over SSH: OpenCode runs on your own always-on Linux box or VPS that you keep awake. Path 3, opencode serve or opencode web: a headless server on your own host reached from Safari over Tailscale, OpenCode's own self-hosted remote design. A dashed dead-end shows iSH and a-Shell cannot run it because modern Node.js crashes and there is no npm install path.
The three real OpenCode-on-iPhone paths and where the agent runs, checked 2026-06-30 against the OpenCode README and server docs. Diagram, not a screenshot.

Quick decision. Jump to what matches your situation:

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:

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.

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.

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.

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:

cosyra on iPhone, connecting a provider to OpenCode

$ 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:

cosyra on iPhone, starting OpenCode

$ 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:

cosyra on iPhone, one-handed on the platform

$ 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.

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.

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.

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.

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.

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.

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.

See pricing