Installation & Setup Linux Install

OpenClaw on Termux: Run AI Agents on Android Without Root

Your Android phone is a capable Linux server — Termux proves it. OpenClaw runs on Termux with no root required, giving you a pocket AI agent gateway that connects to Telegram, Slack, or any channel you configure. Here's exactly how to set it up and keep it running.

MK
M. Kim
AI Product Specialist
Feb 18, 2025 14 min read Linux Install
Updated Feb 2025
Key Takeaways
Use Termux from F-Droid — the Play Store version is outdated and will cause Node.js version problems.
Install Node.js via pkg install nodejs — this gives you the current LTS version within Termux's package system.
Disable battery optimization for Termux in Android settings, or Android will kill the process within minutes.
Use Termux:Boot to auto-start OpenClaw on device reboot — without it, every restart requires a manual start.
Termux OpenClaw is accessible on your local network at your device's Wi-Fi IP — useful for Telegram webhook integration.

Three hundred people in the OpenClaw community Discord run their agents on old Android phones. It's not a hack — Termux provides a genuine Linux environment with working package management, Node.js, and network access. The hard part isn't the install. It's keeping the process alive against Android's aggressive memory killer. Get that right and you have a 24/7 AI agent running on hardware that costs $0 extra.

Before You Start

You need an Android device running Android 7.0 or newer. No root required. The device should have at least 2 GB of RAM — ideally 3 GB or more. OpenClaw's gateway process uses 80–150 MB of RAM, and Android needs headroom for its own processes.

You also need a reliable internet connection for the initial setup — Termux will download about 200 MB of packages. After setup, OpenClaw needs internet only for LLM API calls and channel webhooks.

⚠️
Wi-Fi Required for Webhook Channels
If you plan to use Telegram or other webhook-based channels, your Android device needs a stable, routable IP address — ideally connected to Wi-Fi with a fixed local IP. Mobile data IPs change and are often behind carrier NAT, which blocks incoming webhook connections.

Install Termux Correctly

The Play Store version of Termux is abandoned. Its packages are months or years out of date. Install from F-Droid instead.

  1. Enable "Install from unknown sources" for your browser in Android settings
  2. Open your browser and download the F-Droid APK from f-droid.org
  3. Install F-Droid, open it, and search for "Termux"
  4. Install Termux from F-Droid — current version is 0.118 or newer
  5. Also install Termux:Boot from F-Droid — you'll need this for autostart

Once Termux opens, update all packages before doing anything else:

pkg update && pkg upgrade -y

This takes a few minutes. Let it finish completely before continuing.

Install Node.js in Termux

Termux's package manager includes Node.js. The version in current Termux repos satisfies OpenClaw's requirements:

pkg install nodejs -y

Verify the installation:

node --version   # should be v18 or newer
npm --version    # should be v9 or newer

If node reports a version below 18, your Termux packages are outdated. Run pkg update && pkg upgrade again. If still outdated, reinstall Termux from F-Droid.

💡
Storage Permission
Run termux-setup-storage after installing Termux. This grants access to your Android storage so you can read/write files in /sdcard from within Termux — useful for accessing gateway.yaml or log files from your file manager app.

Install and Configure OpenClaw

Install OpenClaw globally with npm:

npm install -g openclaw

Verify the install:

openclaw --version

Initialize the gateway configuration:

mkdir -p ~/openclaw && cd ~/openclaw
openclaw gateway init

This creates gateway.yaml in your openclaw directory. Edit it with nano:

nano gateway.yaml

Set your gateway token, LLM provider API key, and any channel configurations (Telegram bot token, etc.). Save with Ctrl+O, exit with Ctrl+X.

Test that OpenClaw starts correctly:

cd ~/openclaw && openclaw gateway start

You should see the gateway startup messages and a confirmation that it's listening on port 8080. Stop it with Ctrl+C — you'll run it properly in the background next.

Keep OpenClaw Running in the Background

Android kills background processes. This is the most important part of the Termux setup and the step most people get wrong.

First, disable battery optimization for Termux. Go to Android Settings → Apps → Termux → Battery → Unrestricted (or "Don't optimize"). The exact path varies by Android version and manufacturer. On Samsung devices it's under Device Care → Battery → App Power Management.

Next, acquire a wakelock to prevent the CPU from sleeping while OpenClaw is running:

termux-wake-lock

Run this every time you start OpenClaw. The wakelock keeps Termux active even when the screen is off.

Use nohup to detach OpenClaw from the terminal session:

cd ~/openclaw && nohup openclaw gateway start > openclaw.log 2>&1 &
echo $! > openclaw.pid

To stop it later: kill $(cat ~/openclaw/openclaw.pid)

Autostart with Termux:Boot

Termux:Boot runs scripts on device reboot. Create the autostart script:

mkdir -p ~/.termux/boot
cat > ~/.termux/boot/openclaw.sh << 'EOF'
#!/data/data/com.termux/files/usr/bin/bash
termux-wake-lock
cd ~/openclaw
nohup openclaw gateway start > openclaw.log 2>&1 &
EOF
chmod +x ~/.termux/boot/openclaw.sh

After a device reboot, Termux:Boot automatically runs this script. OpenClaw starts without any manual intervention.

Accessing OpenClaw from Your Network

Find your device's local IP address:

ifconfig wlan0 | grep "inet "

Or on newer Android versions:

ip addr show wlan0 | grep "inet "

The output shows your device's Wi-Fi IP — something like 192.168.1.42. OpenClaw binds to 0.0.0.0:8080 by default, so it's reachable at http://192.168.1.42:8080 from any device on the same network.

Use this IP when configuring Telegram webhooks or any channel that needs to reach your gateway. For external access from the internet, you need a tunnel — ngrok or Cloudflare Tunnel work well from Termux.

Common Mistakes

  • Using Play Store Termux — outdated packages, old Node.js, broken install. Always use F-Droid.
  • Skipping battery optimization disable — Android kills Termux within 15–30 minutes of screen-off. This is the #1 complaint in the community.
  • Forgetting termux-wake-lock — without it, the CPU sleeps and OpenClaw stops responding even if Termux stays running.
  • Installing OpenClaw before updating packages — old package index may resolve to an incompatible Node.js version.
  • Using mobile data for webhook channels — carrier NAT blocks incoming connections. Wi-Fi or a tunnel service is required.

Frequently Asked Questions

Can I run OpenClaw on Android without rooting my phone?

Yes. Termux provides a full Linux environment on Android without root. Install Node.js via pkg, then install OpenClaw with npm. The gateway runs as a regular Termux process — no root, no special permissions beyond storage access.

Will OpenClaw keep running when I close the Termux app on Android?

Not by default — Android kills background processes aggressively. Use Termux:Boot to start OpenClaw on device boot, and acquire a wakelock via termux-wake-lock. Also disable battery optimization for Termux in Android settings to prevent the OS from killing it.

How do I access the OpenClaw gateway from another device on the same network?

Find your Android device's local IP with ifconfig or ip addr in Termux. OpenClaw binds to 0.0.0.0 by default, so it's reachable at http://[android-ip]:8080 from other devices on the same Wi-Fi network. Use this address in your Telegram or channel webhook configs.

Which Termux version should I use — Play Store or F-Droid?

Use the F-Droid version. The Play Store version of Termux is outdated and no longer receives updates — its Node.js packages are old and may not satisfy OpenClaw's minimum version requirement. Download Termux from F-Droid or the official Termux GitHub releases page.

How much RAM does OpenClaw need on Android?

OpenClaw's gateway process uses roughly 80–150 MB of RAM. On a device with 3 GB or more of total RAM, it runs comfortably alongside normal Android apps. On 2 GB devices, Android's memory pressure killer may terminate Termux — use a wakelock and keep RAM usage low.

Can I use Termux OpenClaw with cloud LLM providers like Anthropic or OpenAI?

Yes. OpenClaw on Termux connects to cloud LLM APIs over the network just like any other platform. Set your ANTHROPIC_API_KEY or OPENAI_API_KEY in ~/.bashrc or gateway.yaml. The LLM calls go outbound from your Android device's internet connection.

MK
M. Kim
AI Product Specialist
M. Kim tests OpenClaw deployments across unconventional platforms including Android, Raspberry Pi, and embedded Linux. Focuses on practical setups that run reliably on consumer hardware with minimal maintenance.
Stay Current
New OpenClaw guides every week — straight to your inbox.