🦞 OpenClaw on Termux: The "Sagar Builds" Guide
Most people run OpenClaw on $2,000 Mac Studios or AWS instances. This guide shows you how to run the full Gateway, Browser Control, and WhatsApp/Telegram channels directly on Android using Termux.
📺 Video Guide
🛠️ Prerequisites
- Android Device: Android 10 or higher.
- Termux: Installed from F-Droid (not Play Store).
- API Key: Use the Gemini API from Google AI Studio for a generous free tier. No need for a paid OpenAI or Anthropic subscription to get started.
1. Environment Setup
Standard Termux has issues with OpenClaw’s native dependencies. We use proot-distro to create a stable Ubuntu environment.
# Update Termux
pkg update && pkg upgrade -y
pkg install proot-distro -y
# Install & Login to Ubuntu
proot-distro install ubuntu
proot-distro login ubuntu
2. Install Dependencies
Inside your new Ubuntu shell, install Node.js 22 and the global package.
apt update && apt upgrade -y
apt install curl git build-essential -y
# Install Node 22
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
apt install -y nodejs
# Install OpenClaw globally
npm install -g openclaw@latest
3. The "Bionic Bypass" (Crucial)
Android's kernel blocks the os.networkInterfaces() call, which causes a System Error 13 crash. We fix this by "hijacking" the Node.js runtime before the bot even starts.
Create the Hijack Script:
cat <<EOF > /root/hijack.js
const os = require('os');
os.networkInterfaces = () => ({});
EOF
Make it permanent for all OpenClaw commands:
echo 'export NODE_OPTIONS="-r /root/hijack.js"' >> ~/.bashrc
source ~/.bashrc
4. The Onboarding Wizard
Since we installed globally, you can run the wizard from anywhere. This will link your API keys and pair your WhatsApp/Telegram.
openclaw onboard
[!IMPORTANT] Gateway Bind: When the wizard asks for the Gateway Bind, select Loopback (127.0.0.1). Choosing LAN/0.0.0.0 will trigger a crash on non-rooted Android devices.
5. Launching the Gateway
To start the engine and see the logs in real-time (perfect for Reel footage):
openclaw gateway --verbose
🏁 Verified Commands
Once the gateway is live, use these chat commands in your linked WhatsApp/Telegram:
/status— Check the health of your pocket agent./think high— Put the bot in "deep reasoning" mode./reset— Clear the current session memory.
If you want to chat using the web gateway, then copy the "token" vlue from the file ~/.openclaw/openclaw.json and paste it at openclaw localhost web gateway -> Overview -> Gateway Access -> Gateway Token.
Pro-Tips
- Keep it Alive: Android will kill Termux in the background. Run
termux-wake-lockin a separate Termux session and disable "Battery Optimization" for Termux. - The UI: Access your dashboard by going to
http://127.0.0.1:18789in your phone's browser. Get your token usingopenclaw config get gateway.auth.token. - Security: Never show your full API keys or Gateway tokens in your videos. Revoke the keys used during setup once you finish filming your "Success" shot.