Opencode + termux: better than claude code?
I recently used this setup to:
- Build what looks like a $10,000 website
- Automate my entire Termux environment
- Run OpenCode inside VS Code (which itself runs in termux)
And I haven't paid a single rupee for any of this.
The best part?
The free limits are surprisingly generous. Even after doing all of this, I still had plenty of usage left, and the limits reset every day.
So let’s get started.
Installing OpenCode
The first thing we need is Ubuntu running inside Termux. We’ll use "proot-distro" for this.
Start by updating the Termux repositories:
pkg update && pkg upgradeNow install "proot-distro":
pkg install proot-distroOnce that's installed, install Ubuntu:
proot-distro install ubuntuAfter the installation finishes, log into Ubuntu:
proot-distro login ubuntuNow we're inside Ubuntu.
The next step is installing OpenCode.
Run the OpenCode installation command:
apt update ; apt install nodejs npm -y ; npm i -g opencode-aiOnce it's installed, simply run:
opencodeAnd that's it.
Get Technical Bot’s stories in your inbox
Join Medium for free to get updates from this writer.
OpenCode is now running directly on phone.
Now if you just want to use as it is, but I have one more thing which is that you can automate your whole termux (indirectly whole phone) by connecting termux with opencode.
Setting Up Termux MCP
For doing so, we can use a tool called Termux MCP
So open a new session in termux and install termux mcp by executing following command
curl -fsSL https://github.com/TecnicalBot/termux-mcp/raw/main/scripts/install.sh | bashonce that’s done, start the mcp server
termux-mcp serve httpnow to connect to it, get back to the session where opencode was running, and give it following prompt and it will configure termux mcp automatically, below is the prompt
I want you to configure Termux MCP as a remote mcp server and the MCP URL for same is: http://127.0.0.1:3000/mcpOnce it finishes configuring, just exit opencode by doing /exit then open opencode again
opencodenow if you do /mcp you should be able to see termux mcp connected there.
You can even ask opencode itself to check it, below is the prompt
Check if termux mcp is connected or notAfter that you can ask opencode to do anything you want with termux like scanning local network with nmap, below is the prompt
Using Termux MCP,
Install nmap and then scan my local networkBuilding Website
To build amazing websites, you have to give amazing prompts
luckily for us we have a website called https://motionsites.ai
which has too many crazy websites design with the prompt that can be used to get that exact result
Just copy the prompt there and paste it in opencode, and done.
Here’s the video version of this article: https://youtu.be/Ni6oyaliZEw









