Skip to content

OpenCode on iPhone: 3 Ways to Run It

Updated 8 min read By Adam Roman, Co-founder of Cosyra

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 container with OpenCode already installed that you reach from a native iOS app. Tap the OpenCode shortcut and you are in the TUI, on a free model. Plans start at $20/month, and eligible new users can start a 7-day free trial in the App Store app. 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.

I took the Cosyra steps and screenshots below in the Cosyra 2.9.0 iPhone app on November 3, 2026. The OpenCode reply and provider screens are OpenCode's own and date from October.

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 run a native aarch64 community build of OpenCode, or fall back to a proot-distro chroot, to get closer to the metal (we cover both 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 container with one-tap shortcuts for OpenCode, Claude Code, Codex, Cursor, Grok and Antigravity, 30 GB of storage, and hibernation that resumes exactly where you left off. We put the agents one tap away 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?

Install Cosyra from the App Store, start your workspace and tap the OpenCode shortcut. OpenCode is already installed and opens on a free model, so there is no Node install, no SSH tunnel and no API key for the first prompt. It takes about three minutes.

Step 1

Install Cosyra on iPhone

Install Cosyra from the App Store. Sign in with Apple, Google, GitHub or email, then pick a plan: Core or Pro.

The app opens on Terminals. On a new account the chip next to the title says Not started. Tap Start your workspace once and it turns Awake.

Cosyra Terminals screen on iPhone: workspace Awake, the Your shortcuts row with Claude Code, Codex and Cursor, and the Home project

Step 2

Tap the OpenCode shortcut

The Your shortcuts row holds Claude Code, Codex, Cursor, Grok, Antigravity and OpenCode. On an iPhone the first three fit on screen, so swipe the row to the left and tap OpenCode. It opens in a terminal in your workspace. There is no install step and no sign-in screen. The workspace had OpenCode 2.2.4 when I took these screenshots.

The line under the prompt shows the agent and the model: Build and Big Pickle, a free model from OpenCode Zen. The footer shows the folder you are in.

OpenCode 2.2.4 start screen in a Cosyra terminal on iPhone, on the Build agent with the Big Pickle model

Step 3

Send a first prompt

Tap the terminal to bring up the keyboard, type a request and press return. I asked for a hello world script in Python and for it to be run. OpenCode wrote hello.py, ran it and printed the output.

The free model has a daily message limit. When you reach it, OpenCode shows Free limit reached with the reset time and points you to /connect and /models.

OpenCode wrote hello.py, ran python3 hello.py and printed Hello, World!

Step 4

Connect your own provider

Type /connect and press return. OpenCode lists its providers, with the popular ones first:

  • OpenCode Zen and OpenCode Go
  • OpenAI, with a ChatGPT plan or an API key
  • GitHub Copilot
  • Anthropic
  • Google

Pick one and follow its sign-in. Then switch models with /models.

OpenCode Connect a provider dialog listing OpenCode Zen, OpenAI, GitHub Copilot, Anthropic and Google

Step 5

Run OpenCode in your own repo

Go back to Terminals, tap New and choose New terminal. I ran opencode --version && node --version && git --version and got OpenCode 2.2.4, Node 22.23.4 and git 2.34.1.

Clone your repository, cd into it and type opencode.

The toolbar above the keyboard has Esc, Tab, Ctrl and the arrow keys. Tap Ctrl for Shift+Tab, which switches OpenCode between its Build and Plan agents, and Ctrl+C, which interrupts it. OpenCode keeps running in the workspace when you leave the terminal.

Cosyra terminal printing opencode v2.2.4, Node v22.23.4 and git version 2.34.1, with the key toolbar above the keyboard

Step 6

Prefer a chat? Tap Code

Open the sidebar and tap Code. It opens a chat instead of a terminal.

The model chip next to the message box opens the picker. New chats start on OpenCode's free models: GLM-5.3-Flash and DeepSeek V4.1 Flash when I checked.

Cosyra chat model picker listing OpenCode Free models GLM-5.3-Flash and DeepSeek V4.1 Flash

Try Cosyra. Eligible new users can start a 7-day free trial in the App Store app. 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 From $20/mo 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 pre-installed agents and the native iOS app. On Cosyra, OpenCode starts on Big Pickle, a free OpenCode Zen model with a daily message limit, so the first prompts need no key. For more, run /connect and pay that provider directly.

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 and pick a plan. Eligible new users can start a 7-day free trial in the App Store app.

Run OpenCode from your iPhone in 3 minutes. Install Cosyra, tap the OpenCode shortcut and send your first prompt.

See pricing