How to use OpenCode on your phone
Want to use the opencode AI coding agent from your
phone? You don't have to wrestle with Termux, SSH tunnels, or a tiny terminal. The clean way is a
native Android app: run opencode serve on your computer, install
OpenCode Mobile, and connect. Five minutes, then you're coding with AI from your pocket.
Free, open-source Android client. No Termux required.
Get OpenCode MobileThe short answer: phone = UI, computer = engine
opencode is a terminal AI coding agent. It runs where your code lives — your laptop, desktop, or a
VPS — and it ships with a built-in server mode (opencode serve) that exposes an HTTP API.
You don't need to run the agent on the phone. Instead, OpenCode Mobile connects to that server
and gives you a real native interface: session list, streaming chat, inline diffs, and tool-call
approval. Your code, your API keys, and all AI traffic stay between your server and your provider —
the app is a thin client that never proxies anything through anyone else.
Set up opencode on your phone in 4 steps
Step 1 — Start opencode in server mode
On the machine where opencode is installed, run:
OPENCODE_SERVER_PASSWORD=yourpassword \
opencode serve --hostname 0.0.0.0 --port 4096
Setting a password turns on authentication so only you can connect. (Don't have opencode yet?
Install it with npm install -g opencode.)
Step 2 — Install OpenCode Mobile
Add the F-Droid repo https://dzianisv.github.io/opencode-mobile/fdroid/repo in any
F-Droid client, or grab the
signed APK directly.
See the download page for QR codes.
Step 3 — Add a connection
Open the app, tap Add Connection, and enter your server URL and the password from step 1:
- Same Wi-Fi — use your computer's LAN IP, e.g.
http://192.168.1.100:4096 - From anywhere — expose the server with Tailscale, a Cloudflare Tunnel, or ngrok, and use that URL
Step 4 — Code from your phone
Tap Connect and you're in. Browse and resume sessions, send prompts, watch responses stream token-by-token, and review every diff before you approve it. Lock the app behind your fingerprint for good measure.
Reaching your server from outside your home network
On the same Wi-Fi, the LAN IP just works. To use opencode on your phone over cellular or away from home, give the server a reachable address. The most common options:
| Option | Best for | Notes |
|---|---|---|
| Tailscale | Private, always-on access | Free; gives your machine a stable IP only your devices can reach. Use http://100.x.x.x:4096. |
| Cloudflare Tunnel | A public HTTPS URL | Free; a named tunnel keeps a stable hostname across restarts. |
| ngrok | Quick temporary testing | Free tier gives a random URL each run; a static domain needs a paid plan. |
For step-by-step instructions on each method, see access opencode from your phone remotely.
Why not just use Termux?
Termux is great if you live in a terminal, but for day-to-day AI coding on a phone it means installing Node, compiling native modules on ARM, wiring up a tunnel by hand, and squinting at a TUI on a 6-inch screen — then redoing parts of it after updates. If your goal is to use opencode, a native client is faster and far less brittle. We wrote a full OpenCode Mobile vs Termux comparison if you want the details.
Frequently asked questions
Can I run opencode on my phone?
Yes — but you run opencode serve on your computer or VPS, then connect with the OpenCode Mobile Android app. The phone becomes a native UI for your sessions, with no terminal, SSH keys, or Termux required.
Do I need Termux to use opencode on Android?
No. Termux works but requires installing Node, compiling native modules on the phone, and building a tunnel by hand. OpenCode Mobile is a purpose-built client — install it, enter your server URL once, and connect.
How do I connect my phone to my opencode server?
On the same network, use the server's LAN IP (e.g. http://192.168.1.100:4096). To reach it from anywhere, expose the server with Tailscale, a Cloudflare Tunnel, or ngrok and use that URL in the app.
Is OpenCode Mobile free?
Yes — free and open source under the MIT license. No ads, no required accounts, no tracking by default. You bring your own opencode server and AI provider keys.
Does it work on iPhone?
Not yet. OpenCode Mobile is Android-only today. iOS is on the roadmap.
Ready to code from your phone?
Download OpenCode MobileNew here? Read the full setup guide, see the feature list, or compare it to ChatGPT & Copilot.