Posted: 4/22/2026 | Updated: April 22, 2026
This guide is similar to Run Qwen Code AI from Slack on your own machine, but it is written for using an Android phone as the server host.
Why use Android Termux?
A phone can act as a cheap local server for your Qwen Code Slack bot. It’s not a replacement for a dedicated machine, but it works well for a private automation workflow if your phone can stay awake and keep Termux running.
I tested this on an older spare phone, and the biggest surprise was how often the app would stop if the wake lock or storage prompt wasn't handled first.
Use this guide when you want:
- a local bot without cloud hosting
- an Android device as the host for the Python script
- a lightweight, mobile-friendly server for Slack Socket Mode
What you need
- An Android phone with Termux installed
- A Slack app with Socket Mode enabled
- Python installed in Termux
- The Qwen Code Slack bot repo cloned in Termux
- Wake lock permission and storage access granted
I usually do this on a spare device, not my daily driver, so the bot has a clean Termux install and there is less chance of the phone sleeping due to normal use.
Setup the Android host
- Install Termux from Google Play, F-Droid, or GitHub.
- Open Termux and run:
pkg update && pkg upgrade -y
pkg install python git
- Allow storage access:
termux-setup-storage
- Keep the phone awake while the bot is running:
termux-wake-lock
If the phone sleeps and the bot goes offline, this is usually the first thing to check. I also keep the device plugged in during long runs so the wake lock doesn't drain the battery.
Clone the bot repo
git clone https://github.com/Fr0z3nRebel/qwen-code-slack.git
cd qwen-code-slack
pip3 install -r requirements.txt
cp .env.example .env
Set QWEN_WORK_DIR in .env to the folder you want the bot to access.
Run the bot on Android
Edit .env with your Slack tokens and any environment values the script needs. Then start the bot:
python3 bot.py
Keep that Termux session open or run the process under termux-services if you want it to survive a disconnect. I often use a terminal multiplexer in Termux so I can reconnect without losing the bot session.
Android-specific troubleshooting
| Issue | Solution |
|---|---|
qwen: command not found | Ensure the PATH in your run script includes /data/data/com.termux/files/usr/bin. |
| Bot goes offline when phone sleeps | Verify WakeLock is active in the Termux notification. |
| Service won't start | Run botlogs to see if there's a Python syntax error or missing .env file. If botlogs is empty, check that .env is named correctly and that Termux has permission to read it. |
Notes on PATH
Termux uses a different filesystem than desktop Linux. If your run script or launcher does not include /data/data/com.termux/files/usr/bin, the qwen or python3 command may not resolve.
Notes on wake lock
The Termux notification must show an active wake lock. If Android kills the app, the bot will stop even if the script is correct.
See also
- Run Qwen Code AI from Slack on your own machine for the desktop/server version.
- Install Python on Android with Termux for installing Python on Termux.
- Use Termux and Homebrew on Android without root for a broader Termux Linux environment.