Running on Android
AgentZero runs as a CLI binary on Android — it is not a native Android app. The recommended environment is Termux, a terminal emulator that provides a full Linux environment on your phone or tablet.
Supported Architectures
Section titled “Supported Architectures”| Target | Android Version | Devices |
|---|---|---|
aarch64 (ARM64) | Android 5.0+ (API 21+) | Modern 64-bit phones and tablets |
armv7 (32-bit ARM) | Android 4.1+ (API 16+) | Older 32-bit devices |
Option 1: Pre-built Binary via Termux
Section titled “Option 1: Pre-built Binary via Termux”1. Install Termux
Section titled “1. Install Termux”Download from F-Droid (recommended) or GitHub releases.
2. Detect Your Architecture
Section titled “2. Detect Your Architecture”uname -m# aarch64 = 64-bit (most modern phones)# armv7l or armv8l = 32-bit3. Download and Install
Section titled “3. Download and Install”# For 64-bit (aarch64) — most devices:curl -LO https://github.com/auser/agentzero/releases/latest/download/agentzero-linux-aarch64chmod +x agentzero-linux-aarch64mv agentzero-linux-aarch64 $PREFIX/bin/agentzero
# For 32-bit (armv7):curl -LO https://github.com/auser/agentzero/releases/latest/download/agentzero-linux-armv7chmod +x agentzero-linux-armv7mv agentzero-linux-armv7 $PREFIX/bin/agentzero4. Verify and Set Up
Section titled “4. Verify and Set Up”agentzero --versionagentzero onboardOption 2: Install Script
Section titled “Option 2: Install Script”The install script auto-detects your architecture:
curl -fsSL https://raw.githubusercontent.com/auser/agentzero/main/scripts/install.sh | bashOption 3: Build from Source in Termux
Section titled “Option 3: Build from Source in Termux”For the latest code or when pre-built binaries are unavailable:
# Install build dependenciespkg update && pkg install rust git
# Clone and buildgit clone https://github.com/auser/agentzero.gitcd agentzerocargo build -p agentzero --release
# Installcp target/release/agentzero $PREFIX/bin/Minimal Build
Section titled “Minimal Build”For constrained devices with limited storage or RAM, build with minimal features:
cargo build -p agentzero --release --no-default-features --features memory-sqliteThis produces a smaller binary (~15 MB) with just CLI + local SQLite storage, skipping optional subsystems like RAG, hardware peripherals, and extra communication channels.
Option 4: Cross-Compilation from Desktop
Section titled “Option 4: Cross-Compilation from Desktop”Build on your development machine and push to the device.
Prerequisites
Section titled “Prerequisites”- Android NDK
- Rust with Android targets
# Add Android targetsrustup target add aarch64-linux-android armv7-linux-androideabi
# Set NDK pathexport ANDROID_NDK_HOME=/path/to/android-ndkexport PATH=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH# 64-bit (aarch64)cargo build -p agentzero --release --target aarch64-linux-android
# 32-bit (armv7)cargo build -p agentzero --release --target armv7-linux-androideabiDeploy via ADB
Section titled “Deploy via ADB”adb push target/aarch64-linux-android/release/agentzero /data/local/tmp/adb shell chmod +x /data/local/tmp/agentzeroadb shell /data/local/tmp/agentzero --versionFeature Flags
Section titled “Feature Flags”When building from source, optional features can be enabled or disabled:
| Feature | Description | Recommended on Android |
|---|---|---|
memory-sqlite | Local SQLite storage (default) | Yes |
hardware | GPIO and peripheral support | No (not available) |
rag | Retrieval-augmented generation | Optional |
channels-standard | Extra communication channels | Optional |
memory-turso | Remote Turso database | Optional (requires network) |
Platform Limitations
Section titled “Platform Limitations”- No systemd: Use Termux’s
termux-servicespackage for daemon mode, or run in the foreground - Storage access: Run
termux-setup-storageto access shared storage (photos, downloads, etc.) - Network binding: Some features may require Android VPN permission for local port binding
- No hardware peripherals: GPIO and peripheral features are not available on Android
Running the Gateway
Section titled “Running the Gateway”Start the gateway in foreground mode:
agentzero gateway --host 127.0.0.1 --port 8080For auto-start on boot, install termux-boot:
pkg install termux-bootmkdir -p ~/.termux/bootcat > ~/.termux/boot/agentzero.sh << 'EOF'#!/data/data/com.termux/files/usr/bin/shtermux-wake-lockagentzero daemon start --host 127.0.0.1 --port 8080EOFchmod +x ~/.termux/boot/agentzero.shTroubleshooting
Section titled “Troubleshooting””Permission denied"
Section titled “”Permission denied"”chmod +x agentzero"not found” or wrong binary
Section titled “"not found” or wrong binary”Make sure you downloaded the correct architecture for your device. Check with uname -m.
Linker errors during cross-compilation
Section titled “Linker errors during cross-compilation”Verify that ANDROID_NDK_HOME is set correctly and the NDK toolchain binaries are on your PATH.
Out of memory during source build
Section titled “Out of memory during source build”Termux runs within Android’s memory limits. Try reducing parallel jobs:
cargo build -p agentzero --release -j2Next Steps
Section titled “Next Steps”- Quick Start — Set up config and run your first agent message
- Config Reference — Full annotated configuration file
- Gateway Deployment — Reverse proxy and Docker setup