Install OpenCode V2 on Termux in one line — no fuss. Plus direct pairing with OpenCode Mobile from the Play Store.
curl -fsSL https://raw.githubusercontent.com/JackRipper-ID/opencode-termux/main/install.sh | bashGo straight to pairing as well:
curl -fsSL https://raw.githubusercontent.com/JackRipper-ID/opencode-termux/main/install.sh | bash -s -- --pairThe installer shows live progress, keeps long output out of your face, and stops with a clear message if a step fails.
| # | Step | Details |
|---|---|---|
| 1 | Check environment | Confirms Termux, aarch64 and ~1.5 GB of free space |
| 2 | Install dependencies | proot-distro, curl, tar |
| 3 | Prepare Debian | proot rootfs + apt update |
| 4 | Install OpenCode | The official opencode.ai/v2/install inside Debian |
| 5 | Launcher | opencode → binds your project folder to /workspace automatically |
| 6 | Pairing | opencode-pair → QR + link for OpenCode Mobile |
| 7 | Config | ~/.config/opencode/opencode.json (shared by host and proot) |
Nothing is repackaged. You get the official OpenCode linux-arm64 build, run through proot because OpenCode does not ship a native Android build yet.
cd ~/project
opencodeThe folder you run opencode from is bound to /workspace inside proot, so the agent sees your project — not the Termux root filesystem.
-
Install OpenCode from the Play Store — package
ai.opencode.mobilecode. -
In Termux, run:
opencode-pair
A QR code and a one-time link appear (valid for 5 minutes).
-
Scan the QR or paste the link into the app. Your Termux sessions show up on your phone.
Prefer the same Wi-Fi only (no tunnel)?
opencode-pair --localKeep the
opencode-pairterminal open while your phone is connected — the server runs inside proot and dies with the session.
termux-wake-lock- Termux from F-Droid or GitHub releases — not the outdated Play Store build
- aarch64 / ARM64 Android device
- ~1.5 GB of free space
- An internet connection
Check your architecture:
uname -m # should print aarch64-h, --help show this help
-v, --version <ver> install a specific OpenCode version
--distro <name> proot distro (default: debian)
--pair run pairing right after install
--uninstall remove launcher + distro
--no-color disable colors
--dry-run check the environment only
Examples:
# a specific version
bash install.sh --version 2.0.6
# check first without changing anything
bash install.sh --dry-run
# a different distro
bash install.sh --distro ubuntucurl -fsSL https://raw.githubusercontent.com/JackRipper-ID/opencode-termux/main/uninstall.sh | bashRemoves the opencode and opencode-pair launchers and the proot rootfs. Your config in ~/.config/opencode is intentionally left alone.
| Symptom | Fix |
|---|---|
This script must run inside Termux |
Run it in Termux, not inside proot or over SSH |
Architecture ... is not supported |
The device must be ARM64 (uname -m → aarch64) |
| Installer stops at a step | The full log path is printed at the end of the output |
| QR expired | Links are valid for 5 minutes — run opencode-pair again |
| Phone cannot connect | Make sure the pairing terminal is still open; try opencode-pair --local on the same Wi-Fi |
| Server dies when the screen turns off | termux-wake-lock, and disable battery optimization for Termux |
proot-distro error during install |
pkg update && pkg install --reinstall proot-distro |
opencode-termux/
├── install.sh # installer + pairing
├── uninstall.sh # cleanup
├── preview.svg # README banner
└── LICENSE
Built by JackRipper-ID · AjralDEV