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.

Xiao Liu Lab
Xiao Liu Lab
Xiao Liu Lab
Turn Your Android Phone into a Portable Linux Development Workstation with Termux

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.list

Replace 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 main

Update the package index:

pkg update && pkg upgrade

3. Install common utilities

pkg install git curl wget vim nano openssh python nodejs npm rust clang make

Development 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.git

Running Python scripts

python3 your_script.py

Jupyter Notebook (optional)

pip install jupyter
jupyter notebook --ip=0.0.0.0 --port=8888 --no-browser --allow-root

Access the notebook at http://localhost:8888 from the phone's browser.

Remote SSH access

ssh user@your-server-ip

Editor choices

Lightweight editors: vim, nano. Modern editor with mouse support:

pkg install micro

Advanced Tips

Termux:API

pkg install termux-api

Example 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‑attach

Common 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

Termux Linux on Android
Termux Linux on Android
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

mobile developmentAndroiddevopsLinuxShellTermux
Xiao Liu Lab
Written by

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!

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.