How to run an AI coding agent on your Android phone
This guide walks you through running the OpenCode AI coding agent on a machine you control and driving it from your Android phone with OpenCode Mobile — a free, open-source client. You self-host the agent, keep your AI provider keys on your own server, and code from anywhere.
OpenCode Mobile is a thin client, not a hosted service. The actual AI coding agent runs on your computer; the app connects to it over the network. That means your code and your API keys never pass through anyone else's servers.
What you need
- An OpenCode server — a computer (laptop, desktop, or VPS) where you run
opencode serve. - A way to reach it from your phone — Tailscale is the simplest secure option; a Cloudflare Tunnel, ngrok, or the same local Wi-Fi network also work.
- Your own AI provider key — OpenAI, Anthropic, Gemini, or another provider OpenCode supports. The key lives on your server. Your keys, your bill.
- An Android phone — there is no iOS app.
Step-by-step setup
-
Run
opencode serveon your machineInstall OpenCode if you haven't already, then start it in server mode. Bind it to all interfaces and set a password so only you can connect:
npm install -g opencode OPENCODE_SERVER_PASSWORD=yourpassword opencode serve --hostname 0.0.0.0 --port 4096Configure your AI provider key on this machine (for example via OpenCode's auth flow or an environment variable). The key never leaves your server.
-
Expose the server to your phone
Pick whichever fits your setup:
- Tailscale (recommended) — install Tailscale on both the server and your phone, then connect to your machine's Tailscale IP, e.g.
http://100.x.x.x:4096. Encrypted, no ports to open. - Cloudflare Tunnel / ngrok — get a public HTTPS URL such as
https://my-opencode.trycloudflare.com. - Local network — if the phone and machine share Wi-Fi, use the machine's LAN IP, e.g.
http://192.168.1.100:4096.
- Tailscale (recommended) — install Tailscale on both the server and your phone, then connect to your machine's Tailscale IP, e.g.
-
Install OpenCode Mobile
Two supported ways to install on Android today:
F-Droid (recommended, auto-updates). Add this repository in any F-Droid client (F-Droid, Droid-ify, Neo Store), then search for "OpenCode Mobile":
https://dzianisv.github.io/opencode-mobile/fdroid/repoDirect APK. Download the latest signed release and install it (you may need to allow installation from unknown sources):
-
Connect and start a session
Open the app, tap Add Connection, choose your connection type (local network, tunnel, or Tailscale), enter your server URL and the password from step 1, and tap Connect.
Once connected, create a session and start prompting. The agent runs on your server; responses stream token-by-token to your phone. Review file changes in the inline diff viewer and approve or reject tool calls before they run.
Troubleshooting & notes
- Can't connect? Confirm
opencode serveis running and bound to0.0.0.0(not just127.0.0.1), and that the URL and port match what you entered in the app. - Tailscale not reachable? Make sure both devices are signed into the same Tailscale network and showing as connected, then use the server's Tailscale IP.
- Wrong password? The app password must match
OPENCODE_SERVER_PASSWORDexactly. - Where do my keys live? On your server only. The app stores just your server URL and password, kept in the Android Keystore via secure storage.
- Local network only at home? The LAN IP works only while the phone is on the same Wi-Fi. For access from anywhere, use Tailscale or a tunnel.
- Privacy. No ads, no analytics SDKs, and optional crash reporting is off by default. See the privacy policy.
OpenCode Mobile is free and open source under the MIT license. It is an independent client for the OpenCode agent and is not affiliated with the OpenCode upstream project beyond using its open API.
Start coding from your phone
Spin up your server, install the app, and connect — you'll be running an AI coding agent from your pocket in minutes.