Because Android deserves a shell.
The standard approach to running OpenClaw on Android requires installing proot-distro with Linux, adding 700MB-1GB of overhead. OpenClaw on Android eliminates this by installing just the glibc dynamic linker (ld.so), letting you run OpenClaw without a full Linux distribution.
Standard approach: Install a full Linux distribution in Termux via proot-distro.
┌───────────────────────────────────────────────────┐
│ Linux Kernel │
│ ┌───────────────────────────────────────────────┐ │
│ │ Android · Bionic libc · Termux │ │
│ │ ┌───────────────────────────────────────────┐ │ │
│ │ │ proot-distro · Debian/Ubuntu │ │ │
│ │ │ ┌───────────────────────────────────────┐ │ │ │
│ │ │ │ GNU glibc │ │ │ │
│ │ │ │ Node.js → OpenClaw │ │ │ │
│ │ │ └───────────────────────────────────────┘ │ │ │
│ │ └───────────────────────────────────────────┘ │ │
│ └───────────────────────────────────────────────┘ │
└───────────────────────────────────────────────────┘
This project: No proot-distro — just the glibc dynamic linker.
┌───────────────────────────────────────────────────┐
│ Linux Kernel │
│ ┌───────────────────────────────────────────────┐ │
│ │ Android · Bionic libc · Termux │ │
│ │ ┌───────────────────────────────────────────┐ │ │
│ │ │ glibc ld.so (linker only) │ │ │
│ │ │ ld.so → Node.js → OpenClaw │ │ │
│ │ └───────────────────────────────────────────┘ │ │
│ └───────────────────────────────────────────────┘ │
└───────────────────────────────────────────────────┘
| Standard (proot-distro) | This project | |
|---|---|---|
| Storage overhead | 1-2GB (Linux + packages) | ~200MB |
| Setup time | 20-30 min | 3-10 min |
| Performance | Slower (proot layer) | Native speed |
| Setup steps | Install distro, configure Linux, install Node.js, fix paths... | Run one command |
- Android 7.0 or higher (Android 10+ recommended)
- ~1GB free storage
- Wi-Fi or mobile data connection
The installer automatically resolves the differences between Termux and standard Linux. There's nothing you need to do manually — the single install command handles all of these:
- glibc environment — Installs the glibc dynamic linker (via pacman's glibc-runner) so standard Linux binaries run without modification
- Node.js (glibc) — Downloads official Node.js linux-arm64 and wraps it with an ld.so loader script (no patchelf, which causes segfault on Android)
- Path conversion — Automatically converts standard Linux paths (
/tmp,/bin/sh,/usr/bin/env) to Termux paths - Temp folder setup — Configures an accessible temp folder for Android
- Service manager bypass — Configures normal operation without systemd
- OpenCode integration — If selected, installs OpenCode using proot + ld.so concatenation for Bun standalone binaries
- Prepare Your Phone
- Install Termux
- Initial Termux Setup
- Install OpenClaw — one command
- Start OpenClaw Setup
- Start OpenClaw (Gateway)
Configure Developer Options, Stay Awake, charge limit, and battery optimization. See the Keeping Processes Alive guide for step-by-step instructions.
Important: The Play Store version of Termux is discontinued and will not work. You must install from F-Droid.
- Open your phone's browser and go to f-droid.org
- Search for
Termux, then tap Download APK to download and install- Allow "Install from unknown sources" when prompted
Open the Termux app and paste the following command to install curl (needed for the next step).
pkg update -y && pkg install -y curlYou may be asked to choose a mirror on first run. Pick any — a geographically closer mirror will be faster.
Tip: Use SSH for easier typing From this step on, you can type commands from your computer keyboard instead of the phone screen. See the Termux SSH Setup Guide for details.
Paste the following command in Termux.
curl -sL myopenclawhub.com/install | bash && source ~/.bashrcEverything is installed automatically with a single command. This takes 3–10 minutes depending on network speed and device. Wi-Fi is recommended.
Once complete, the OpenClaw version is displayed along with instructions to run openclaw onboard.
As instructed in the installation output, run:
openclaw onboardFollow the on-screen instructions to complete the initial setup.
Once setup is complete, start the gateway:
Important: Run
openclaw gatewaydirectly in the Termux app on your phone, not via SSH. If you run it over SSH, the gateway will stop when the SSH session disconnects.
The gateway occupies the terminal while running, so open a new tab for it. Tap the hamburger icon (☰) on the bottom menu bar, or swipe right from the left edge of the screen (above the bottom menu bar) to open the side menu. Then tap NEW SESSION.
In the new tab, run:
openclaw gatewayTo stop the gateway, press
Ctrl+C. Do not useCtrl+Z— it only suspends the process without terminating it.
Android may kill background processes or throttle them when the screen is off. See the Keeping Processes Alive guide for all recommended settings (Developer Options, Stay Awake, charge limit, battery optimization, and Phantom Process Killer).
See the Termux SSH Setup Guide for SSH access and dashboard tunnel setup.
If you run OpenClaw on multiple devices on the same network, use the Dashboard Connect tool to manage them from your PC.
- Save connection settings (IP, token, ports) for each device with a nickname
- Generates the SSH tunnel command and dashboard URL automatically
- Your data stays local — Connection settings (IP, token, ports) are saved only in your browser's localStorage and are never sent to any server.
After installation, the oa command is available for managing your installation:
| Option | Description |
|---|---|
oa --update |
Update OpenClaw and Android patches |
oa --install |
Install optional tools (tmux, code-server, AI CLIs, etc.) |
oa --uninstall |
Remove OpenClaw on Android |
oa --status |
Show installation status and all installed components |
oa --version |
Show version |
oa --help |
Show available options |
oa --update && source ~/.bashrcThis single command updates all installed components at once:
- OpenClaw — Core package (
openclaw@latest) - code-server — Browser IDE
- OpenCode — AI coding assistant
- AI CLI tools — Claude Code, Gemini CLI, Codex CLI
- Android patches — Compatibility patches from this project
Already up-to-date components are skipped. Components you haven't installed are not touched — only what's already on your device gets updated. Safe to run multiple times.
If the
oacommand is not available (older installations), run it with curl:curl -sL myopenclawhub.com/update | bash && source ~/.bashrc
See the Troubleshooting Guide for detailed solutions.
CLI commands like openclaw status may feel slower than on a PC. This is because each command needs to read many files, and the phone's storage is slower than a PC's, with Android's security processing adding overhead.
However, once the gateway is running, there's no difference. The process stays in memory so files don't need to be re-read, and AI responses are processed on external servers — the same speed as on a PC.
OpenClaw supports local LLM inference via node-llama-cpp. The prebuilt native binary (@node-llama-cpp/linux-arm64) is included with the installation and loads successfully under the glibc environment — local LLM is technically functional on the phone.
However, there are practical constraints:
| Constraint | Details |
|---|---|
| RAM | GGUF models need at least 2-4GB of free memory (7B model, Q4 quantization). Phone RAM is shared with Android and other apps |
| Storage | Model files range from 4GB to 70GB+. Phone storage fills up fast |
| Speed | CPU-only inference on ARM is very slow. Android does not support GPU offloading for llama.cpp |
| Use case | OpenClaw primarily routes to cloud LLM APIs (OpenAI, Gemini, etc.) which respond at the same speed as on a PC. Local inference is a supplementary feature |
For experimentation, small models like TinyLlama 1.1B (Q4, ~670MB) can run on the phone. For production use, cloud LLM providers are recommended.
Why
--ignore-scripts? The installer usesnpm install -g openclaw@latest --ignore-scriptsbecause node-llama-cpp's postinstall script attempts to compile llama.cpp from source via cmake — a process that takes 30+ minutes on a phone and fails due to toolchain incompatibilities. The prebuilt binaries work without this compilation step, so the postinstall is safely skipped.
Technical Documentation for Developers
The installer sets up infrastructure, platform packages, and optional tools across multiple package managers. Core infrastructure and platform dependencies are installed automatically; optional tools are individually prompted during install.
| Component | Role | Install Method |
|---|---|---|
| git | Version control, npm git dependencies | pkg install |
These are controlled by the platform's config.env flags. For OpenClaw, all are installed:
| Component | Role | Install Method |
|---|---|---|
| pacman | Package manager for glibc packages | pkg install |
| glibc-runner | glibc dynamic linker — enables standard Linux binaries on Android | pacman -Sy |
| Node.js v22 LTS (linux-arm64) | JavaScript runtime for OpenClaw | Direct download from nodejs.org |
| python | Build scripts for native C/C++ addons (node-gyp) | pkg install |
| make | Makefile execution for native modules | pkg install |
| cmake | CMake-based native module builds | pkg install |
| clang | C/C++ compiler for native modules | pkg install |
| binutils | Binary utilities (llvm-ar) for native builds | pkg install |
| Component | Role | Install Method |
|---|---|---|
| OpenClaw | AI agent platform (core) | npm install -g |
| clawdhub | Skill manager for OpenClaw | npm install -g |
| PyYAML | YAML parser for .skill packaging |
pip install |
| libvips | Image processing headers for sharp build | pkg install (on update) |
Each tool is offered via an individual Y/n prompt. You choose which ones to install.
| Component | Role | Install Method |
|---|---|---|
| tmux | Terminal multiplexer for background sessions | pkg install |
| ttyd | Web terminal — access Termux from a browser | pkg install |
| dufs | HTTP/WebDAV file server for browser-based file transfer | pkg install |
| android-tools | ADB for disabling Phantom Process Killer | pkg install |
| code-server | Browser-based VS Code IDE | Direct download from GitHub |
| OpenCode | AI coding assistant (TUI). Auto-installs Bun and proot as dependencies | bun install -g |
| Claude Code (Anthropic) | AI CLI tool | npm install -g |
| Gemini CLI (Google) | AI CLI tool | npm install -g |
| Codex CLI (OpenAI) | AI CLI tool | npm install -g |
openclaw-android/
├── bootstrap.sh # curl | bash one-liner installer (downloader)
├── install.sh # Platform-aware installer (entry point)
├── oa.sh # Unified CLI (installed as $PREFIX/bin/oa)
├── update.sh # Thin wrapper (downloads and runs update-core.sh)
├── update-core.sh # Lightweight updater for existing installations
├── uninstall.sh # Clean removal (orchestrator)
├── patches/
│ ├── glibc-compat.js # Node.js runtime patches (os.cpus, networkInterfaces)
│ ├── argon2-stub.js # JS stub for argon2 native module (code-server)
│ ├── termux-compat.h # C header for Bionic native builds (sharp)
│ ├── spawn.h # POSIX spawn stub header
│ ├── systemctl # systemd stub for Termux
│ ├── apply-patches.sh # Legacy patch orchestrator (v1.0.2 compat)
│ └── patch-paths.sh # Legacy path fixer (v1.0.2 compat)
├── scripts/
│ ├── lib.sh # Shared function library (colors, platform detection, prompts)
│ ├── check-env.sh # Pre-flight environment check
│ ├── install-infra-deps.sh # Core infrastructure packages (L1)
│ ├── install-glibc.sh # glibc-runner installation (L2 conditional)
│ ├── install-nodejs.sh # Node.js glibc wrapper installation (L2 conditional)
│ ├── install-build-tools.sh # Build tools for native modules (L2 conditional)
│ ├── build-sharp.sh # Build sharp native module (image processing)
│ ├── install-code-server.sh # Install/update code-server (browser IDE)
│ ├── install-opencode.sh # Install OpenCode
│ ├── setup-env.sh # Configure environment variables
│ └── setup-paths.sh # Create directories and symlinks
├── platforms/
│ ├── openclaw/ # OpenClaw platform plugin
│ │ ├── config.env # Platform metadata and dependency declarations
│ │ ├── env.sh # Platform-specific environment variables
│ │ ├── install.sh # Platform package install (npm, patches, clawdhub)
│ │ ├── update.sh # Platform package update
│ │ ├── uninstall.sh # Platform package removal
│ │ ├── status.sh # Platform status display
│ │ ├── verify.sh # Platform verification checks
│ │ └── patches/ # Platform-specific patches
│ │ ├── openclaw-apply-patches.sh
│ │ ├── openclaw-patch-paths.sh
│ │ └── openclaw-build-sharp.sh
├── tests/
│ └── verify-install.sh # Post-install verification (orchestrator + platform)
└── docs/
├── termux-ssh-guide.md # Termux SSH setup guide (EN)
├── termux-ssh-guide.ko.md # Termux SSH setup guide (KO)
├── troubleshooting.md # Troubleshooting guide (EN)
├── troubleshooting.ko.md # Troubleshooting guide (KO)
└── images/ # Screenshots and images
The project uses a platform-plugin architecture that separates platform-agnostic infrastructure from platform-specific code:
┌─────────────────────────────────────────────────────────────┐
│ Orchestrators (install.sh, update-core.sh, uninstall.sh) │
│ ── Platform-agnostic. Read config.env and delegate. │
├─────────────────────────────────────────────────────────────┤
│ Shared Scripts (scripts/) │
│ ── L1: install-infra-deps.sh (always) │
│ ── L2: install-glibc.sh, install-nodejs.sh, │
│ install-build-tools.sh (conditional on config.env) │
│ ── L3: Optional tools (user-selected) │
├─────────────────────────────────────────────────────────────┤
│ Platform Plugins (platforms/<name>/) │
│ ── config.env: declares dependencies (PLATFORM_NEEDS_*) │
│ ── install.sh / update.sh / uninstall.sh / ... │
└─────────────────────────────────────────────────────────────┘
Dependency layers:
| Layer | Scope | Examples | Controlled by |
|---|---|---|---|
| L1 | Infrastructure (always installed) | git, pkg update |
Orchestrator |
| L2 | Platform runtime (conditional) | glibc, Node.js, build tools | config.env flags |
| L3 | Optional tools (user-selected) | tmux, code-server, AI CLIs | User prompts |
Each platform declares its L2 dependencies in config.env:
# platforms/openclaw/config.env
PLATFORM_NEEDS_GLIBC=true
PLATFORM_NEEDS_NODEJS=true
PLATFORM_NEEDS_BUILD_TOOLS=trueThe orchestrator reads these flags and conditionally runs the corresponding install scripts. A platform that doesn't need certain dependencies simply sets the corresponding flags to false and those heavy dependencies are skipped entirely.
Running bash install.sh executes the following 8 steps in order.
Validates that the current environment is suitable before starting installation.
- Termux detection: Checks for the
$PREFIXenvironment variable. Exits immediately if not in Termux - Architecture check: Runs
uname -mto verify CPU architecture (aarch64 recommended, armv7l supported, x86_64 treated as emulator) - Disk space: Ensures at least 1000MB free on the
$PREFIXpartition. Errors if insufficient - Existing installation: If
openclawcommand already exists, shows current version and notes this is a reinstall/upgrade - Node.js pre-check: If Node.js is already installed, shows version and warns if below 22
- Phantom Process Killer (Android 12+): Shows an informational note about the Phantom Process Killer with a link to the disable guide
Selects the platform to install. Currently hardcoded to openclaw. Future versions will present a selection UI when multiple platforms are available.
Loads the platform's config.env via load_platform_config() from scripts/lib.sh, which exports all PLATFORM_* variables for use by subsequent steps.
Presents 9 individual Y/n prompts (via /dev/tty) for optional tools:
- tmux, ttyd, dufs, android-tools
- code-server, OpenCode
- Claude Code, Gemini CLI, Codex CLI
All selections are collected upfront before any installation begins. This allows the user to make all decisions at once and walk away during the install.
Always runs regardless of platform selection.
install-infra-deps.sh:
- Runs
pkg update -y && pkg upgrade -yto refresh and upgrade packages - Installs
git(required for npm git dependencies and repo cloning)
setup-paths.sh:
- Creates
$PREFIX/tmpand$HOME/.openclaw-android/patchesdirectories - Displays standard Linux path mappings (
/bin/sh,/usr/bin/env,/tmp) to Termux equivalents
Conditionally installs runtime dependencies based on the platform's config.env flags:
| Flag | Script | What it installs |
|---|---|---|
PLATFORM_NEEDS_GLIBC=true |
scripts/install-glibc.sh |
pacman, glibc-runner (provides ld-linux-aarch64.so.1) |
PLATFORM_NEEDS_NODEJS=true |
scripts/install-nodejs.sh |
Node.js v22 LTS linux-arm64, grun-style wrapper scripts |
PLATFORM_NEEDS_BUILD_TOOLS=true |
scripts/install-build-tools.sh |
python, make, cmake, clang, binutils |
Each script is self-contained with pre-checks and idempotent behavior (skips if already installed).
Delegates to the platform's own install script. For OpenClaw, this:
- Sets
CPATHfor glib-2.0 headers (needed for native module builds) - Installs PyYAML via pip (for
.skillpackaging) - Copies
glibc-compat.jsto~/.openclaw-android/patches/ - Installs
systemctlstub to$PREFIX/bin/ - Runs
npm install -g openclaw@latest --ignore-scripts - Applies platform-specific patches via
openclaw-apply-patches.sh - Installs
clawdhub(skill manager) andundicidependency if needed - Runs
openclaw update(includes building native modules like sharp)
[6.5] Environment Variables + CLI + Marker:
After platform install, the orchestrator:
- Runs
setup-env.shto write the.bashrcenvironment block - Evaluates the platform's
env.shfor platform-specific variables - Writes the platform marker file (
~/.openclaw-android/.platform) - Installs
oaCLI andoaupdatewrapper to$PREFIX/bin/ - Copies
lib.sh,setup-env.sh, and the platform directory to~/.openclaw-android/for use by the updater and uninstaller
Installs the tools selected in Step 3:
- Termux packages: tmux, ttyd, dufs, android-tools — installed via
pkg install - code-server: Browser-based VS Code IDE with Termux-specific workarounds (replace bundled node, patch argon2, handle hard link failures)
- OpenCode: AI coding assistant using proot + ld.so concatenation for Bun standalone binaries
- AI CLI tools: Claude Code, Gemini CLI, Codex CLI — installed via
npm install -g
Runs a two-tier verification:
Orchestrator checks (FAIL level):
| Check Item | PASS Condition |
|---|---|
| Node.js version | node -v >= 22 |
| npm | npm command exists |
| TMPDIR | Environment variable is set |
| OA_GLIBC | Set to 1 |
| glibc-compat.js | File exists in ~/.openclaw-android/patches/ |
| .glibc-arch | Marker file exists |
| glibc dynamic linker | ld-linux-aarch64.so.1 exists |
| glibc node wrapper | Wrapper script at ~/.openclaw-android/node/bin/node |
| Directories | ~/.openclaw-android, $PREFIX/tmp exist |
| .bashrc | Contains environment variable block |
Orchestrator checks (WARN level, non-critical):
| Check Item | PASS Condition |
|---|---|
| code-server | code-server --version succeeds |
| opencode | opencode command available |
Platform verification — delegates to platforms/<platform>/verify.sh:
| Check Item | PASS Condition |
|---|---|
| openclaw | openclaw --version succeeds |
| CONTAINER | Set to 1 |
| clawdhub | Command available |
| ~/.openclaw | Directory exists |
All FAIL-level items pass → PASSED. Any FAIL → shows reinstall instructions. WARN items do not cause failure.
Running oa --update (or oaupdate for backward compatibility) downloads the latest release tarball from GitHub and executes the following 5 steps.
Validates the minimum conditions for updating.
- Checks
$PREFIXexists (Termux environment) - Checks
curlis available - Detects platform from
~/.openclaw-android/.platformmarker file - Detects architecture: glibc (
.glibc-archmarker) or Bionic (legacy) - Migrates old directory name if needed (
.openclaw-lite→.openclaw-android— legacy compatibility) - Phantom Process Killer (Android 12+): Shows an informational note with a link to the disable guide
Downloads the full repository tarball from GitHub and extracts to a temp directory. Validates that all required files exist:
scripts/lib.shscripts/setup-env.shplatforms/<platform>/config.envplatforms/<platform>/update.sh
Updates shared files used by the updater, uninstaller, and CLI:
- Copies the latest platform directory to
~/.openclaw-android/platforms/ - Updates
lib.shandsetup-env.shin~/.openclaw-android/scripts/ - Updates patch files (
glibc-compat.js,argon2-stub.js,spawn.h,systemctl) - Updates
oaCLI andoaupdatewrapper in$PREFIX/bin/ - Updates
uninstall.shin~/.openclaw-android/ - If Bionic architecture detected, performs automatic glibc migration
- Runs
setup-env.shto refresh.bashrcenvironment block
Delegates to platforms/<platform>/update.sh. For OpenClaw, this:
- Installs build dependencies (
libvips,binutils) - Updates
openclawnpm package to latest version - Re-applies platform-specific patches
- Rebuilds sharp native module if openclaw was updated
- Updates/installs
clawdhub(skill manager) - Installs
undicifor clawdhub if needed (Node.js v24+) - Migrates skills from
~/skills/to~/.openclaw/workspace/skills/if needed - Installs PyYAML if missing
Updates tools that are already installed:
- code-server: Runs
install-code-server.shin update mode. Skipped if not installed - OpenCode: Updates if installed; offers to install if not. Requires glibc architecture
- AI CLI tools (Claude Code, Gemini CLI, Codex CLI): Compares installed vs latest npm version, updates if needed. Tools not installed are not offered for installation
MIT



