☕ Buy a Coffee
Home / Mobile IT & Tools

Use 'Termux' to Run a Full Linux Terminal on Android

Turn your Android smartphone into a portable Linux workstation capable of running Python, Node.js, Git, SSH servers, and penetration testing tools.

Sachin Siju
Sachin Siju
Lead Systems Engineer & Tech Blogger
Jul 07, 2026 4 min read
Use 'Termux' to Run a Full Linux Terminal on Android

A Real Linux Environment, No Root Required

Termux gives you a genuine Linux userland on Android — a proper package manager, a real shell, and access to interpreters, compilers, and networking tools — running entirely as a normal app, with no root access needed for the vast majority of what you'll want to do. It's not a VM and it's not emulating Linux syscalls from scratch; it's a native ARM/ARM64 Linux environment running under Android's own Linux kernel, which is why it performs close to native and why the package ecosystem (built specifically for Termux's environment) is as extensive as it is.

Important: Install Termux from F-Droid, not the Google Play Store. The Play Store build was deprecated by the developers in 2023 and no longer receives updates — packages will fail to install or run correctly against it. Get F-Droid from f-droid.org, then install Termux through F-Droid.

Initial Setup

  1. Install F-Droid, then search for and install Termux through it.
  2. Open Termux. You land directly in a bash shell.
  3. Update the package index and upgrade everything to current versions before installing anything else:
    pkg update && pkg upgrade
  4. Grant Termux access to your phone's shared storage (Downloads, Pictures, etc.) so you can move files in and out of the Linux environment:
    termux-setup-storage
    Accept the Android permission prompt that appears. This creates a ~/storage folder inside Termux with symlinks into your phone's actual storage.

Installing Development Tools

Termux uses its own package manager, pkg (a wrapper around apt), with a repository built specifically for the Android/Termux environment. Install whatever your workflow needs:

pkg install python
pkg install nodejs
pkg install git
pkg install openssh

Each of these behaves like its desktop Linux counterpart — python3, node, npm, and git all work exactly as you'd expect, with pip available for Python packages.

Running an SSH Server

With openssh installed, start the SSH daemon:

sshd

Termux's sshd listens on port 8022 by default (not 22, since binding low ports requires root Termux doesn't have). Set a password for your Termux user first with passwd, then connect from another machine on the same network:

ssh -p 8022 u0_a123@192.168.1.50

Find your Termux username by running whoami inside Termux (it's auto-generated, typically u0_a followed by a number), and find your phone's IP with ifconfig or by checking Wi-Fi details in Android Settings.

Getting a Full Distro with proot-distro

Termux's native environment covers most CLI tools, but if you need a complete, unmodified distro — full Ubuntu or Debian, with their standard package repositories rather than Termux's own — install proot-distro, which sets up a chrooted container using proot (no root access needed on the host):

pkg install proot-distro
proot-distro install ubuntu
proot-distro login ubuntu

You're now inside a real Ubuntu filesystem with apt, systemd-free service management, and access to any package in Ubuntu's standard repos — useful for tools that assume a specific glibc-based distro rather than Termux's own package layout.

Keeping Termux Alive in the Background

Android aggressively kills background processes to save battery, which will silently terminate long-running Termux sessions (an SSH server, a script left running) unless you tell the OS not to:

  1. Inside Termux, run termux-wake-lock to prevent the CPU from sleeping while Termux is active.
  2. In Android Settings, find Termux under Apps → Termux → Battery and set battery optimization to Unrestricted so Android doesn't kill it in the background.
  3. Swipe down the notification shade and keep Termux's persistent notification visible rather than swiping it away — dismissing it can trigger Android to reclaim the process.

Extending Termux with Termux:API

Install the separate Termux:API app (also from F-Droid) alongside the termux-api package to script against actual phone hardware from the command line — battery status, GPS location, clipboard, camera, notifications, and SMS, all callable as shell commands like termux-battery-status or termux-location.

What You Still Need Root For

Most development work — running servers, compiling, scripting, SSH — needs no root at all. Root is only required for things that need raw hardware or network-stack access below what Android's sandboxing allows: raw socket packet capture, certain penetration-testing tools that need monitor-mode Wi-Fi, or modifying system partitions. If you're not rooted, those specific tool categories won't work regardless of how they're installed.

Wrap-Up

Termux turns an idle Android phone into a legitimate portable Linux box capable of real development work — editing and running code, SSHing into other machines, hosting a lightweight server — without touching root. Install from F-Droid, run termux-setup-storage and a pkg upgrade first, and the rest of the Linux tooling you already know works almost exactly like it does on a desktop.

Featured Infrastructure Partner

Deploy on High-Performance Hostinger Cloud

Get up to 75% OFF + free domain & SSL. Powering xube.me's sub-second response times.

Claim Discount ↗

Discussion & Insights

Related Technical Essays