Turn Your Android Phone into a Portable Linux Development Workstation with Termux
This guide shows how to install and configure Termux on an Android device to create a full‑featured Linux development environment, covering package sources, essential tools, Git workflow, Python, Jupyter, SSH, editors, Termux:API, Zsh, tmux, and common troubleshooting steps.
What is Termux
Termux is an open‑source terminal emulator for Android that provides a Linux‑like environment without requiring root access. It includes a lightweight apt‑compatible package manager and can install development tools such as Python, Node.js, Go, Rust, Git, SSH, Vim, tmux, and can run services like Nginx or Flask.
Basic Setup
1. Install Termux
Install the latest version from F‑Droid (https://f-droid.org/). The first launch initializes the environment automatically.
2. Switch to a fast mirror
nano $PREFIX/etc/apt/sources.listReplace the file content with a mirror of your choice, for example the Tsinghua University mirror:
deb https://mirrors.tuna.tsinghua.edu.cn/termux/termux-packages-24 stable mainUpdate the package index:
pkg update && pkg upgrade3. Install common utilities
pkg install git curl wget vim nano openssh python nodejs npm rust clang makeDevelopment Environment
Version control with Git
git config --global user.name "YourName"
git config --global user.email "[email protected]"
git clone https://github.com/your/repo.gitRunning Python scripts
python3 your_script.pyJupyter Notebook (optional)
pip install jupyter
jupyter notebook --ip=0.0.0.0 --port=8888 --no-browser --allow-rootAccess the notebook at http://localhost:8888 from the phone's browser.
Remote SSH access
ssh user@your-server-ipEditor choices
Lightweight editors: vim, nano. Modern editor with mouse support:
pkg install microAdvanced Tips
Termux:API
pkg install termux-apiExample commands:
termux-camera-photo photo.jpg
termux-sms-send -n 13800138000 "Hello"
termux-toast "Task completed!"Zsh and Oh My Zsh
pkg install zsh
sh -c "$(curl -fsSL https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh)"Background services with tmux
pkg install tmux
tmux new -s dev # start a session
# Press Ctrl+B then D to detach
tmux attach -t dev # re‑attachCommon Issues & Precautions
Storage permission : Run termux-setup-storage to grant access to /sdcard.
Executable scripts : Make scripts executable with chmod +x script.sh.
Path differences : Termux uses $PREFIX (usually /data/data/com.termux/files/usr) instead of the standard Linux root path.
Performance limits : Mobile CPU and memory are limited; avoid compiling very large projects, but everyday scripting and web development work well.
Reference Image
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Xiao Liu Lab
An operations lab passionate about server tinkering 🔬 Sharing automation scripts, high-availability architecture, alert optimization, and incident reviews. Using technology to reduce overtime and experience to avoid major pitfalls. Follow me for easier, more reliable operations!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
