- an Android phone or tablet with a 64-bit CPU;
- Termux installed from F-Droid (its maintained distribution channel — the Play Store build is not the one to use; confirm the current status in the Termux documentation);
- no root, no unlocked bootloader, no custom recovery;
- free storage for the Linux root filesystem plus whatever AI runtime and model files you plan to use — check the size your distribution reports before installing;
- optional: a PC with an SSH client to reach the phone over Wi-Fi.
root inside the container, while Android itself is untouched.
Install nothing except Termux. Everything else is installed from inside Termux.
termux-setup-storage on first use.termux-wake-lock stops Android from freezing the session mid-build.adb (ADB — Android Debug Bridge, the developer command channel), see Shizuku: running ADB commands on Android without a PC.Know what each layer does before you type anything:
| Layer | What it does | Needs root |
|---|---|---|
| Termux | Terminal emulator plus package manager, lives in its own app data directory | no |
| PRoot | Translates system calls in user space so an ordinary app can act as `root` inside a fake filesystem tree | no |
| proot-distro | Termux package that installs and starts full Linux distributions on top of PRoot | no |
| Guest distribution | The Linux userland where your tools actually run | no |
| AI runtime | The inference engine or CLI you want to use | no |
Pre-flight checklist:
termux-setup-storage run and the Android permission dialog acceptedtermux-wake-lock enabledExample: run uname -m in Termux. On a 64-bit ARM phone it prints aarch64. If it prints armv7l or i686, you are on a 32-bit build and some distributions or runtimes will not be installable.
What to do: update the Termux package index, install proot-distro, grant storage access, and keep the session awake.
pkg update && pkg upgrade -y
pkg install proot-distro -y
termux-setup-storage
termux-wake-lockWhy: pkg is Termux's own package manager (a wrapper around apt, but pointed at Termux's repositories — not your phone's system). proot-distro is the tool that downloads a Linux root filesystem and starts it through PRoot. termux-setup-storage is what actually makes /sdcard readable, because on modern Android an app cannot read shared storage until the user grants it.
How to check: proot-distro list prints the supported distributions and the alias you must pass to install. The exact list depends on your version — treat the printed list as the source of truth.
echo $PREFIXExpected output: /data/data/com.termux/files/usr. That path is the whole Termux world; nothing outside it belongs to Termux.
Example: after termux-setup-storage succeeds, ls /sdcard/Download lists your Downloads folder. If it answers Permission denied, the Android dialog was dismissed — run the command again and accept it.

What to do: install the guest system and enter it.
proot-distro install ubuntu
proot-distro login ubuntuIf ubuntu is not the alias your proot-distro list printed, substitute the one that is there (for example a Debian or Alpine alias).
Inside the guest, bring the system up to date and add the basics:
apt update && apt upgrade -y
apt install -y python3 python3-pip git curlWhy: PRoot intercepts the system calls a Linux program makes and rewrites paths and user IDs on the fly. That is why you become uid=0(root) inside the container even though the Android app itself has no root permissions, and why no kernel module, bootloader unlock, or recovery is involved. The cost is overhead: everything is emulated in user space, so anything needing real kernel features — Docker containers, KVM virtualization, FUSE mounts — will not work here.
apt is the guest's package manager and pkg is Termux's. They are two separate systems; a package installed in one is invisible to the other.
How to check: inside the guest run:
id
cat /etc/os-releaseExpected: uid=0(root) gid=0(root) groups=0(root) from id, and a PRETTY_NAME="..." line from /etc/os-release naming the distribution you installed.
Example: the prompt changes from Termux's ~ $ to something like root@localhost:~#. That prompt change is the fastest confirmation that you are inside the container; exit returns you to Termux.
What to do: prove the environment works with a trivial program, then install the AI runtime you want.
python3 - <<'EOF'
import platform, sys
print(sys.version.split()[0], platform.machine())
EOFExpected output: something like 3.12.x aarch64. The version depends on your distribution's repositories — check what your distro ships rather than expecting one specific number.
Then install the runtime. Use an inference engine or CLI that publishes Termux/ARM installation instructions and follow that document literally; flags, build steps, and supported model formats differ per tool, so treat them as unknown here and verify them in the tool's own docs.
Example workflow for a local model: copy a .gguf model file (GGUF — a single-file format used by many local runners) to /sdcard/Download/, then pass that path as a read-only input to your runtime from inside the guest. Exact filenames, quantization names, and flags depend on the runtime.
Example check from a PC:
pkg install openssh
sshd
passwdTermux's SSH server listens on port 8022 (not 22) by default. From the PC: ssh -p 8022 <termux-user>@<phone-ip>. This lets you build in a real keyboard-and-monitor setup while the phone does the compute. If you would rather run models in a ready-made Android app instead of a container, compare the options in How to Run an AI Model Locally on Android: Apps and Setup.
Success checklist:
id inside the guest prints uid=0(root)python3 runs and prints an aarch64 machine string/sdcard/Download/exit returns you to Termux, and proot-distro login ubuntu gets you back inProblem. apt is not found, even though you are "in Linux"
bash: apt: command not foundapt; it uses pkg.proot-distro login <alias>, confirm you see the root@localhost:~# prompt, then run apt update again.Problem. A binary refuses to start after you installed something in the other environment
CANNOT LINK EXECUTABLE "python3": library "libcrypto.so.1.1" not found$PREFIX versus /usr/lib). Symlinking or copying one into the other breaks at link time.apt install -y libssl-dev (or whichever library the message names), then reinstall the tool. Keep Termux packages in Termux and guest packages in the guest — never symlink $PREFIX into the container.Problem. The guest cannot see your files on /sdcard
ls: cannot access '/sdcard': No such file or directorytermux-setup-storage was never run (or the permission was denied), and even then the container only sees the paths that are mapped into it.termux-setup-storage in Termux and accept the dialog, then check ls /sdcard/Download. If the host can see it but the guest cannot, bind the path on login — for example proot-distro login --bind /sdcard ubuntu. Bind mount support and the flag name vary between releases, so confirm with proot-distro login --help before relying on it; the safe fallback is to copy the file into the guest with cp.Problem. A large download or build dies when the screen turns off
proot-distro starts from scratch.termux-wake-lock in Termux before starting the job, keep the phone on the charger, and disable battery optimization for Termux in Android settings (Settings → Apps → Termux → Battery).You now have a root-capable Linux userland on an unrooted Android device, reachable locally or over SSH on port 8022. Next, pick the AI runtime that matches your storage and patience, and read Best AI apps for Android in 2026 to decide whether a dedicated app beats maintaining a container.
Do I need to root my phone or unlock the bootloader?
No. Termux, PRoot, and proot-distro all run as an ordinary Android app in user space; the root you see is simulated inside the container.
Can I run Docker or Android apps inside the PRoot container?
No. Docker needs real kernel privileges and cgroups, and Android apps need an Android runtime — PRoot only translates system calls, it does not provide those kernel features.
Why is everything slower than on a PC?
Because every system call is intercepted and rewritten in user space. We have no measured benchmark for this setup, so do not trust a specific percentage — measure your own workload and compare.
Can I get a graphical desktop in the container?
Yes in principle: install a desktop environment and a VNC server inside the guest, then connect with a VNC client on the same phone over 127.0.0.1. Package names differ per distribution, so check the documentation for your distro before installing.
Status: practical guide. Some statements come from vendors; verify in your environment.
A step-by-step guide to running full Linux on an Android smartphone without root using Termux and PRoot, including installing AI coding assistants. Time to complete: roughly 30–60 minutes on a first run — almost all of it is download time and depends on your connection and device. Difficulty: Intermediate (you should be comfortable typing commands into a terminal).
Machine data: Citation Map JSON · JSON-LD · Semantic Embeddings — separate stage.
| Entity | Type | Role |
|---|---|---|
| Linux on Android without root | тема/инструмент | упоминается в заголовке, TL;DR или разделах гайда |
| Termux and PRoot Linux | тема/инструмент | упоминается в заголовке, TL;DR или разделах гайда |
| Run Linux on Android | тема/инструмент | упоминается в заголовке, TL;DR или разделах гайда |
| Linux | платформа/технология | упоминается в заголовке, TL;DR или разделах гайда |
| Android | платформа/технология | упоминается в заголовке, TL;DR или разделах гайда |
| Docker | платформа/технология | упоминается в заголовке, TL;DR или разделах гайда |
| Python | платформа/технология | упоминается в заголовке, TL;DR или разделах гайда |
| Git | платформа/технология | упоминается в заголовке, TL;DR или разделах гайда |
No independent confirmation is provided; source claims and editorial conclusions are separated below.
| Source | Type | Role |
|---|---|---|
| No external links | — | — |
Cite as: AI Release. Как запустить Linux на Android без root: Termux, PRoot и ИИ-инструменты. ai-release.org.
In short: A step-by-step guide to running full Linux on an Android smartphone without root using Termux and PRoot, including installing AI coding assistants.