OpenClaw AI Gateway for Android | Termux Setup
Run OpenClaw AI Gateway on Android via Termux—one-command setup, no root required. Flutter app with terminal, web dashboard, and local LLM access.
Originally published:
Run OpenClaw AI Gateway on Android Without Root
OpenClawd-Termux brings the OpenClaw AI gateway to Android devices, eliminating the need for rooting while providing a full Ubuntu environment via proot. This project solves a critical gap for developers and AI enthusiasts who want to run a local, multi-model AI gateway on mobile hardware—supporting Claude, Gemini, OpenAI, and other LLM providers through a unified interface.
Purpose and Significance
OpenClaw is a unified AI gateway that abstracts multiple LLM APIs behind a single, OpenAI-compatible interface. OpenClawd-Termux extends this to Android by automating the entire setup pipeline: downloading Ubuntu rootfs, installing Node.js 22, configuring proot-distro, and launching the gateway—all without requiring device rooting. This unlocks use cases for mobile development, offline AI access, and edge deployment scenarios where cloud connectivity is unreliable.
Key Features
Flutter App (Standalone)
- One-Tap Setup: Downloads Ubuntu rootfs, Node.js, and OpenClaw automatically with a single button press
- Built-in Terminal Emulator: Full shell access with extra keys toolbar, copy/paste support, and clickable URL detection
- Gateway Controls: Start/stop the gateway with real-time status indicators and health checks
- Token URL Capture: Automatically extracts and displays auth tokens from onboarding with copy-to-clipboard functionality
- Embedded Web Dashboard: WebView loads the OpenClaw dashboard at localhost:18789 with authentication pre-configured
- Real-Time Log Viewer: Stream and filter gateway logs directly in the app
- Foreground Service: Keeps the gateway running in the background with Android's native lifecycle management
- Settings Panel: Configure auto-start behavior, review system info, disable battery optimization, and re-run setup if needed
Termux CLI Package
- One-Command Installation: Single curl/npm install line handles proot-distro, Ubuntu, Node.js 22, and OpenClaw setup
- Bionic Bypass: Automatically patches os.networkInterfaces() crash that occurs on Android's Bionic libc
- Smart Polling: Shows spinner UI until gateway is ready for connections
- Pass-Through Commands: Run any OpenClaw command (doctor, gateway, config) via openclawdx wrapper
Architecture Overview
The project uses a layered architecture: the Flutter app (Dart) provides the UI layer with a Kotlin native bridge communicating to a proot container running Ubuntu, Node.js, and OpenClaw. This design isolates the gateway from Android's restrictions while maintaining full interoperability with the native mobile environment.
Getting Started
Flutter App (Recommended for Most Users)
- Clone the repository:
git clone https://github.com/mithun50/openclawd-termux.git - Build the APK:
cd openclawd-termux/flutter_app && flutter build apk - Install on your Android 10+ device
- Open the app and tap Begin Setup
- After setup completes, configure API keys in the Onboarding screen
- Tap Start Gateway and access the dashboard at the token URL displayed in the app
Termux CLI (One-Liner)
Install Termux from F-Droid (not Play Store), then run:
curl -fsSL https://raw.githubusercontent.com/mithun50/openclawd-termux/main/install.sh | bash
Or via npm: npm install -g openclawd-termux
Then execute setup: openclawdx setup
Requirements
- Android: Version 10 or higher
- Storage: ~500MB for Ubuntu rootfs, Node.js, and OpenClaw binaries
- RAM: 2GB minimum recommended for stable gateway operation
- Termux CLI: Must install Termux from F-Droid, not Google Play Store
Who This Project Is For
- Mobile AI Developers: Test and debug LLM-based apps with local gateway access
- Edge Deployment Engineers: Deploy unified AI interfaces on edge devices without cloud dependency
- Open-Source Contributors: Extend OpenClaw or contribute to the Flutter/Dart mobile ecosystem
- Privacy-Conscious Users: Run local AI inference and proxying without sending requests to external servers
- Termux Power Users: Leverage proot-distro to bring full Linux tooling to Android CLI workflows
Configuration
Onboarding Setup: Configure binding to Loopback (127.0.0.1) for non-rooted devices. Add your Gemini, OpenAI, or Claude API keys. The app automatically captures the token URL from the gateway's onboarding flow.
Battery Optimization: Critical for background operation. Disable battery optimization in Android Settings > Apps > Battery > Unrestricted for the app or Termux.
Dashboard Access: Open the token URL shown in the app (e.g., http://localhost:18789/#token=...) to access the full OpenClaw web dashboard with pre-configured authentication.
Troubleshooting
If the gateway won't start, run openclawdx status to check installation state. If you encounter an os.networkInterfaces() error, re-run setup with openclawdx setup to apply the Bionic bypass patch. If the process is killed in the background, ensure battery optimization is disabled for the app in Android settings.
proot-distro openclaw-ai-gateway flutter-android-development
Source: OpenClawd-Termux GitHub repository. MIT licensed. Last updated February 2026.
Original Source
https://github.com/mithun50/openclawd-termux
Last updated: