npm 'opencode' returns 404 (does not exist); the real package is 'opencode-ai' (v1.18.3, bin: opencode). Three docs-site pages — including the setup guide the app's empty state and demo CTA link to — told users to run 'npm install -g opencode', which hard-fails at step 1 and bounces them before they ever connect. Every other place in the repo already uses opencode-ai. Verified via npm registry. Corrects guide/, landing index, and opencode-on-phone pages. Claude-Session: https://claude.ai/code/session_01T12AhSnQVrSxNnvwfCx2z6 Co-authored-by: engineer <engineer@macbookpro.lan> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
364 lines
18 KiB
HTML
364 lines
18 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
<title>How to Use OpenCode on Your Phone — The Easy Way (Android)</title>
|
|
<meta name="description" content="The simplest way to run the opencode AI coding agent on your phone. Skip the Termux SSH rabbit hole — install OpenCode Mobile, point it at your server, and code from anywhere on Android." />
|
|
<meta name="keywords" content="opencode on phone, setup opencode on phone, opencode android, use opencode on android, run opencode from phone, opencode mobile app, opencode cli phone, opencode android setup, how to use opencode on phone" />
|
|
<meta name="theme-color" content="#3b82f6" />
|
|
<link rel="canonical" href="https://dzianisv.github.io/opencode-mobile/opencode-on-phone/" />
|
|
<link rel="icon" type="image/png" href="../fdroid/repo/icons/icon.png" />
|
|
|
|
<!-- Open Graph -->
|
|
<meta property="og:type" content="article" />
|
|
<meta property="og:site_name" content="OpenCode Mobile" />
|
|
<meta property="og:title" content="How to Use OpenCode on Your Phone — The Easy Way (Android)" />
|
|
<meta property="og:description" content="The simplest way to run the opencode AI coding agent on your phone. Skip the Termux SSH rabbit hole — install OpenCode Mobile and code from anywhere on Android." />
|
|
<meta property="og:url" content="https://dzianisv.github.io/opencode-mobile/opencode-on-phone/" />
|
|
<meta property="og:image" content="https://dzianisv.github.io/opencode-mobile/og.png" />
|
|
|
|
<!-- Twitter -->
|
|
<meta name="twitter:card" content="summary_large_image" />
|
|
<meta name="twitter:title" content="How to Use OpenCode on Your Phone — The Easy Way (Android)" />
|
|
<meta name="twitter:description" content="The simplest way to run the opencode AI coding agent on your phone. Skip the Termux SSH rabbit hole." />
|
|
<meta name="twitter:image" content="https://dzianisv.github.io/opencode-mobile/og.png" />
|
|
|
|
<!-- Structured data: BreadcrumbList -->
|
|
<script type="application/ld+json">
|
|
{
|
|
"@context": "https://schema.org",
|
|
"@type": "BreadcrumbList",
|
|
"itemListElement": [
|
|
{ "@type": "ListItem", "position": 1, "name": "OpenCode Mobile", "item": "https://dzianisv.github.io/opencode-mobile/" },
|
|
{ "@type": "ListItem", "position": 2, "name": "OpenCode on your phone", "item": "https://dzianisv.github.io/opencode-mobile/opencode-on-phone/" }
|
|
]
|
|
}
|
|
</script>
|
|
|
|
<!-- Structured data: HowTo -->
|
|
<script type="application/ld+json">
|
|
{
|
|
"@context": "https://schema.org",
|
|
"@type": "HowTo",
|
|
"name": "How to use opencode on your phone",
|
|
"description": "Run the opencode AI coding agent from your Android phone by installing OpenCode Mobile and connecting it to your own opencode server.",
|
|
"totalTime": "PT5M",
|
|
"tool": [
|
|
{ "@type": "HowToTool", "name": "An Android phone" },
|
|
{ "@type": "HowToTool", "name": "A computer or VPS running opencode serve" }
|
|
],
|
|
"step": [
|
|
{
|
|
"@type": "HowToStep",
|
|
"position": 1,
|
|
"name": "Start opencode in server mode",
|
|
"text": "On your computer or VPS, run: OPENCODE_SERVER_PASSWORD=yourpassword opencode serve --hostname 0.0.0.0 --port 4096",
|
|
"url": "https://dzianisv.github.io/opencode-mobile/opencode-on-phone/#step-1"
|
|
},
|
|
{
|
|
"@type": "HowToStep",
|
|
"position": 2,
|
|
"name": "Install OpenCode Mobile on your phone",
|
|
"text": "Install the OpenCode Mobile app from the F-Droid repo or the direct APK download.",
|
|
"url": "https://dzianisv.github.io/opencode-mobile/opencode-on-phone/#step-2"
|
|
},
|
|
{
|
|
"@type": "HowToStep",
|
|
"position": 3,
|
|
"name": "Add a connection",
|
|
"text": "Open the app, tap Add Connection, enter your server URL and password, and tap Connect.",
|
|
"url": "https://dzianisv.github.io/opencode-mobile/opencode-on-phone/#step-3"
|
|
},
|
|
{
|
|
"@type": "HowToStep",
|
|
"position": 4,
|
|
"name": "Code from your phone",
|
|
"text": "Browse sessions, send prompts, watch streaming responses, and approve diffs — all from your phone.",
|
|
"url": "https://dzianisv.github.io/opencode-mobile/opencode-on-phone/#step-4"
|
|
}
|
|
]
|
|
}
|
|
</script>
|
|
|
|
<!-- Structured data: FAQPage -->
|
|
<script type="application/ld+json">
|
|
{
|
|
"@context": "https://schema.org",
|
|
"@type": "FAQPage",
|
|
"mainEntity": [
|
|
{
|
|
"@type": "Question",
|
|
"name": "Can I run opencode on my phone?",
|
|
"acceptedAnswer": {
|
|
"@type": "Answer",
|
|
"text": "Yes. You don't run the opencode engine on the phone itself — you run opencode serve on your computer or a VPS, then connect to it with the OpenCode Mobile Android app. The phone becomes a clean native UI for your coding sessions, with no terminal, no SSH keys, and no Termux required."
|
|
}
|
|
},
|
|
{
|
|
"@type": "Question",
|
|
"name": "Do I need Termux to use opencode on Android?",
|
|
"acceptedAnswer": {
|
|
"@type": "Answer",
|
|
"text": "No. Termux works but requires installing Node, compiling native modules on your phone, and setting up a tunnel by hand. OpenCode Mobile is a purpose-built Android client — install it, enter your server URL once, and you're connected."
|
|
}
|
|
},
|
|
{
|
|
"@type": "Question",
|
|
"name": "How do I connect my phone to my opencode server?",
|
|
"acceptedAnswer": {
|
|
"@type": "Answer",
|
|
"text": "If your phone and server are 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."
|
|
}
|
|
},
|
|
{
|
|
"@type": "Question",
|
|
"name": "Is OpenCode Mobile free?",
|
|
"acceptedAnswer": {
|
|
"@type": "Answer",
|
|
"text": "Yes. OpenCode Mobile is free and open source under the MIT license. There are no ads, no required accounts, and no tracking by default. You bring your own opencode server and your own AI provider keys."
|
|
}
|
|
}
|
|
]
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
:root{--bg:#0b0f17;--bg-soft:#121826;--card:#161d2e;--border:#243049;--text:#e6ebf5;--muted:#9aa6be;--accent:#3b82f6;--accent-2:#2563eb;}
|
|
*{box-sizing:border-box}
|
|
html{scroll-behavior:smooth}
|
|
body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Helvetica Neue",Arial,sans-serif;background:var(--bg);color:var(--text);line-height:1.6;-webkit-font-smoothing:antialiased;}
|
|
a{color:var(--accent);text-decoration:none}
|
|
a:hover{text-decoration:underline}
|
|
.wrap{max-width:880px;margin:0 auto;padding:0 20px}
|
|
section{padding:36px 0;border-top:1px solid var(--border)}
|
|
section:first-of-type{border-top:none}
|
|
h1,h2,h3{line-height:1.25;margin:0 0 .5em}
|
|
h1{font-size:2.1rem}
|
|
h2{font-size:1.4rem;margin-top:.2em}
|
|
h3{font-size:1.1rem;margin-top:1.4em}
|
|
code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;background:var(--bg-soft);border:1px solid var(--border);border-radius:6px;padding:2px 6px;font-size:.9em;word-break:break-all;}
|
|
pre{background:var(--bg-soft);border:1px solid var(--border);border-radius:10px;padding:14px 16px;overflow-x:auto;}
|
|
pre code{background:none;border:none;padding:0;word-break:normal}
|
|
.crumbs{font-size:.9rem;color:var(--muted);padding-top:24px}
|
|
.crumbs a{color:var(--muted)}
|
|
.crumbs a:hover{color:var(--accent)}
|
|
.lead{font-size:1.12rem;color:var(--muted)}
|
|
.muted{color:var(--muted)}
|
|
ul li,ol li{margin-bottom:6px}
|
|
.table-wrap{overflow-x:auto;margin:24px 0}
|
|
table{width:100%;border-collapse:collapse;font-size:.97rem}
|
|
thead tr{background:var(--card)}
|
|
th,td{padding:11px 14px;border:1px solid var(--border);text-align:left;vertical-align:top}
|
|
th{color:var(--muted);font-weight:600;font-size:.88rem;text-transform:uppercase;letter-spacing:.03em}
|
|
td:first-child{font-weight:500}
|
|
.yes{color:#4ade80}
|
|
.no{color:#f87171}
|
|
.card{background:var(--card);border:1px solid var(--border);border-radius:12px;padding:20px 22px;margin:16px 0}
|
|
.card h3{margin-top:0;font-size:1.05rem}
|
|
.steps-block{background:var(--bg-soft);border:1px solid var(--border);border-radius:10px;padding:18px 22px;margin:16px 0}
|
|
.steps-block h3{margin-top:0;font-size:1rem;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
|
|
.steps-block ol{margin:0;padding-left:1.3em}
|
|
.steps-block li{margin-bottom:8px}
|
|
.note{background:var(--bg-soft);border:1px solid var(--border);border-left:3px solid var(--accent);border-radius:10px;padding:16px 18px;color:var(--muted)}
|
|
.note strong{color:var(--text)}
|
|
.cta-box{background:var(--card);border:1px solid var(--border);border-left:3px solid var(--accent);border-radius:12px;padding:22px 24px;margin:28px 0;display:flex;flex-wrap:wrap;align-items:center;gap:16px;justify-content:space-between}
|
|
.cta-box p{margin:0;font-size:1.05rem}
|
|
.btn{display:inline-block;background:var(--accent);color:#fff;font-weight:600;padding:10px 22px;border-radius:8px;font-size:.97rem;white-space:nowrap}
|
|
.btn:hover{background:var(--accent-2);text-decoration:none}
|
|
.faq details{background:var(--card);border:1px solid var(--border);border-radius:12px;padding:0 18px;margin-bottom:12px}
|
|
.faq summary{cursor:pointer;padding:16px 0;font-weight:600;list-style:none}
|
|
.faq summary::-webkit-details-marker{display:none}
|
|
.faq summary::after{content:"+";float:right;color:var(--accent);font-weight:700}
|
|
.faq details[open] summary::after{content:"\2212"}
|
|
.faq details[open] summary{border-bottom:1px solid var(--border)}
|
|
.faq details p{color:var(--muted);margin:14px 0 16px}
|
|
footer{border-top:1px solid var(--border);padding:32px 0 48px;text-align:center;color:var(--muted);font-size:.9rem;}
|
|
footer a{margin:0 8px}
|
|
@media(min-width:680px){h1{font-size:2.5rem}}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<div class="wrap">
|
|
<nav class="crumbs" aria-label="Breadcrumb">
|
|
<a href="../">OpenCode Mobile</a> › OpenCode on your phone
|
|
</nav>
|
|
</div>
|
|
|
|
<main>
|
|
<section>
|
|
<div class="wrap">
|
|
<h1>How to use OpenCode on your phone</h1>
|
|
<p class="lead">
|
|
Want to use the <a href="https://github.com/sst/opencode">opencode</a> 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 <code>opencode serve</code> on your computer, install
|
|
<strong>OpenCode Mobile</strong>, and connect. Five minutes, then you're coding with AI from your pocket.
|
|
</p>
|
|
<div class="cta-box">
|
|
<p>Free, open-source Android client. No Termux required.</p>
|
|
<a class="btn" href="../download/">Get OpenCode Mobile</a>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<section id="how-it-works">
|
|
<div class="wrap">
|
|
<h2>The short answer: phone = UI, computer = engine</h2>
|
|
<p>
|
|
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 (<code>opencode serve</code>) that exposes an HTTP API.
|
|
You don't need to run the agent <em>on</em> 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.
|
|
</p>
|
|
</div>
|
|
</section>
|
|
|
|
<section id="setup">
|
|
<div class="wrap">
|
|
<h2>Set up opencode on your phone in 4 steps</h2>
|
|
|
|
<div class="steps-block" id="step-1">
|
|
<h3>Step 1 — Start opencode in server mode</h3>
|
|
<p style="margin-top:0">On the machine where opencode is installed, run:</p>
|
|
<pre><code>OPENCODE_SERVER_PASSWORD=yourpassword \
|
|
opencode serve --hostname 0.0.0.0 --port 4096</code></pre>
|
|
<p style="margin-bottom:0" class="muted">
|
|
Setting a password turns on authentication so only you can connect. (Don't have opencode yet?
|
|
Install it with <code>npm install -g opencode-ai</code>.)
|
|
</p>
|
|
</div>
|
|
|
|
<div class="steps-block" id="step-2">
|
|
<h3>Step 2 — Install OpenCode Mobile</h3>
|
|
<p style="margin:0">
|
|
Add the F-Droid repo <code>https://dzianisv.github.io/opencode-mobile/fdroid/repo</code> in any
|
|
F-Droid client, or grab the
|
|
<a href="https://github.com/dzianisv/opencode-mobile/releases/latest">signed APK</a> directly.
|
|
See the <a href="../download/">download page</a> for QR codes.
|
|
</p>
|
|
</div>
|
|
|
|
<div class="steps-block" id="step-3">
|
|
<h3>Step 3 — Add a connection</h3>
|
|
<p style="margin:0">
|
|
Open the app, tap <strong>Add Connection</strong>, and enter your server URL and the password
|
|
from step 1:
|
|
</p>
|
|
<ul style="margin:10px 0 0">
|
|
<li><strong>Same Wi-Fi</strong> — use your computer's LAN IP, e.g. <code>http://192.168.1.100:4096</code></li>
|
|
<li><strong>From anywhere</strong> — expose the server with Tailscale, a Cloudflare Tunnel, or ngrok, and use that URL</li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="steps-block" id="step-4">
|
|
<h3>Step 4 — Code from your phone</h3>
|
|
<p style="margin:0">
|
|
Tap <strong>Connect</strong> 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.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<section id="reach-from-anywhere">
|
|
<div class="wrap">
|
|
<h2>Reaching your server from outside your home network</h2>
|
|
<p>
|
|
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:
|
|
</p>
|
|
<div class="table-wrap">
|
|
<table>
|
|
<thead><tr><th>Option</th><th>Best for</th><th>Notes</th></tr></thead>
|
|
<tbody>
|
|
<tr><td>Tailscale</td><td>Private, always-on access</td><td>Free; gives your machine a stable IP only your devices can reach. Use <code>http://100.x.x.x:4096</code>.</td></tr>
|
|
<tr><td>Cloudflare Tunnel</td><td>A public HTTPS URL</td><td>Free; a named tunnel keeps a stable hostname across restarts.</td></tr>
|
|
<tr><td>ngrok</td><td>Quick temporary testing</td><td>Free tier gives a random URL each run; a static domain needs a paid plan.</td></tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="note">
|
|
<strong>Always set a server password</strong> when the server is reachable beyond your LAN.
|
|
OpenCode Mobile stores credentials in the Android Keystore, and you can require biometric unlock
|
|
before each send.
|
|
</div>
|
|
<p style="margin-top:14px">For step-by-step instructions on each method, see <a href="../remote-access/">access opencode from your phone remotely</a>.</p>
|
|
</div>
|
|
</section>
|
|
|
|
<section id="why-not-termux">
|
|
<div class="wrap">
|
|
<h2>Why not just use Termux?</h2>
|
|
<p>
|
|
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 <em>use</em>
|
|
opencode, a native client is faster and far less brittle. We wrote a full
|
|
<a href="../vs-termux/">OpenCode Mobile vs Termux comparison</a> if you want the details.
|
|
</p>
|
|
</div>
|
|
</section>
|
|
|
|
<section id="faq" class="faq">
|
|
<div class="wrap">
|
|
<h2>Frequently asked questions</h2>
|
|
<details open>
|
|
<summary>Can I run opencode on my phone?</summary>
|
|
<p>Yes — but you run <code>opencode serve</code> 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.</p>
|
|
</details>
|
|
<details>
|
|
<summary>Do I need Termux to use opencode on Android?</summary>
|
|
<p>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.</p>
|
|
</details>
|
|
<details>
|
|
<summary>How do I connect my phone to my opencode server?</summary>
|
|
<p>On the same network, use the server's LAN IP (e.g. <code>http://192.168.1.100:4096</code>). To reach it from anywhere, expose the server with Tailscale, a Cloudflare Tunnel, or ngrok and use that URL in the app.</p>
|
|
</details>
|
|
<details>
|
|
<summary>Is OpenCode Mobile free?</summary>
|
|
<p>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.</p>
|
|
</details>
|
|
<details>
|
|
<summary>Does it work on iPhone?</summary>
|
|
<p>Not for download yet. The iPhone and iPad build is in active development; follow the <a href="../ios/">iOS progress page</a> for native build and TestFlight status.</p>
|
|
</details>
|
|
</div>
|
|
</section>
|
|
|
|
<section id="cta">
|
|
<div class="wrap">
|
|
<div class="cta-box">
|
|
<p>Ready to code from your phone?</p>
|
|
<a class="btn" href="../download/">Download OpenCode Mobile</a>
|
|
</div>
|
|
<p class="muted" style="margin-top:8px">
|
|
New here? Read the full <a href="../guide/">setup guide</a>, see the
|
|
<a href="../features/">feature list</a>, or compare it to
|
|
<a href="../comparison/">ChatGPT & Copilot</a>.
|
|
</p>
|
|
</div>
|
|
</section>
|
|
</main>
|
|
|
|
<footer>
|
|
<div class="wrap">
|
|
<p>
|
|
<a href="../">Home</a>
|
|
<a href="../guide/">Setup guide</a>
|
|
<a href="../download/">Download</a>
|
|
<a href="../remote-access/">Remote access</a>
|
|
<a href="../vs-termux/">vs Termux</a>
|
|
<a href="../troubleshooting/">Troubleshooting</a>
|
|
<a href="https://github.com/dzianisv/opencode-mobile">GitHub</a>
|
|
</p>
|
|
<p class="muted">Free and open-source. Built by VIBE TECHNOLOGIES, LLC. Not affiliated with the OpenCode upstream project beyond using its open API.</p>
|
|
</div>
|
|
</footer>
|
|
</body>
|
|
</html>
|