Skip to content

Instantly share code, notes, and snippets.

@sahilpatel0x01
Forked from alisolanki/openclaw-setup-guide.md
Last active March 4, 2026 19:57
Show Gist options
  • Select an option

  • Save sahilpatel0x01/739cc4827e68175441080e244a04f84f to your computer and use it in GitHub Desktop.

Select an option

Save sahilpatel0x01/739cc4827e68175441080e244a04f84f to your computer and use it in GitHub Desktop.
Turn an Old Android Into a 24/7 AI Agent (OpenClaw Setup Guide) This guide shows you how to run OpenClaw locally on an Android phone using Termux and Ubuntu. With this setup, your old smartphone can function as a 24/7 AI employee without needing a PC or cloud server. The process is lightweight, fully local, and designed for builders who want to …

Here is the properly formatted README.md file, combining the corrected commands with the original author's structure.

# Turn Your Old Android Into a 24/7 AI Employee
### OpenClaw Setup Guide for Android (Termux)

**Author:** Ali Solanki  

Before starting, watch this full walkthrough video by Ali Solanki:

▶ https://youtu.be/hM5LHJByJZk  
*“I Turned an Old Android into a 24/7 AI Employee (OpenClaw)”*

This guide follows the exact process demonstrated by Ali, with corrected and working commands you can execute directly on your Android device.

---

## What You’re Building

By the end of this guide, your Android phone will:

- Run OpenClaw locally  
- Act as a 24/7 AI agent  
- Be controllable from a web dashboard  
- Operate without a PC or cloud server  

---

## Requirements

Make sure you have:

- Android phone (Android 10 or above recommended)  
- Stable internet connection  
- Gemini API key (from Google AI Studio)  
- Termux installed from **F-Droid** (not Play Store)  

---

## Step 1: Install Termux

1. Go to **https://f-droid.org**
2. Download and install **F-Droid**
3. Search for **Termux**
4. Install Termux
5. Open the Termux app

---

## Step 2: Update Packages

Inside Termux, run:

```bash
pkg update && pkg upgrade -y

Then install proot-distro:

pkg install proot-distro -y

Step 3: Install Ubuntu Inside Termux

Install Ubuntu:

proot-distro install ubuntu

Enter the Ubuntu environment:

proot-distro login ubuntu

Step 4: Install Core Dependencies

Inside the Ubuntu shell, run:

apt update && apt upgrade -y && apt install -y curl git build-essential

Step 5: Install Node.js (Required for OpenClaw)

Add the NodeSource repository for Node.js 22:

curl -fsSL https://deb.nodesource.com/setup_22.x | bash -

Install Node.js:

apt install -y nodejs

Verify installation:

node -v
npm -v

Step 6: Install OpenClaw

Install OpenClaw globally:

npm install -g openclaw@latest

Verify installation:

openclaw --version

Step 7: Fix Android Network Interface Error

Create the hijack script:

cat <<'EOF' > /root/hijack.js
const os = require('os');
os.networkInterfaces = () => ({});
EOF

Make it load automatically:

echo 'export NODE_OPTIONS="-r /root/hijack.js"' >> ~/.bashrc
source ~/.bashrc

Step 8: Run OpenClaw Setup Wizard

Start onboarding:

openclaw onboard

When prompted for Gateway Bind, select:

127.0.0.1 (Loopback)

Step 9: Launch the OpenClaw Gateway

Start the agent:

openclaw gateway --verbose

Step 10: Access the Web Dashboard

Open your mobile browser and go to:

http://127.0.0.1:18789

Get your gateway token:

openclaw config get gateway.auth.token

Paste the token into the dashboard login screen.


Useful Agent Commands

/status

Check agent health.

/think high

Enable deep reasoning mode.

/reset

Clear memory and restart the session.


Stability Tips

Prevent Termux from Sleeping

termux-wake-lock

Disable Battery Optimization

  1. Go to Android Settings
  2. Apps → Termux
  3. Battery
  4. Disable optimization

Keep Device Plugged In

For true 24/7 operation, keep the phone connected to power.


Security Tips

  • Never share your API keys publicly
  • Do not share your gateway token
  • Use a separate Google account for AI keys if possible

What You Can Do Next

  • Automate research tasks
  • Build a personal AI assistant
  • Connect it to messaging apps
  • Use it as a mobile automation node

Final Note

If you followed each step correctly, your Android device is now running a fully functional AI agent locally.

Watch the full walkthrough again:

https://youtu.be/hM5LHJByJZk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment