Android is built on the Linux kernel, but its user space is heavily customized for mobile use. Installing a full Debian environment gives you access to the vast Debian package repository, familiar command‑line tools, and the ability to run scripts or programs that are not packaged for Android. Because the method uses proot (a user‑space chroot implementation) inside Termux, it works on any device that can run the Play Store version of Termux, without requiring root.
Settings > Apps > Termux > Permissions and allow Storage. This lets Termux write the Debian filesystem to /data/data/com.termux/files/home.After the initial setup you should see a prompt that looks like ~ $. This is your Termux shell.
pkg update && pkg upgrade -y
The -y flag automatically answers “yes” to prompts, speeding up the process.
proot-distro, which simplifies the download and setup of Linux distributions:pkg install proot-distro
If you plan to use a graphical desktop later, also install xfce4‑related packages inside Debian (we’ll cover that in Step 6). For now, only proot-distro is needed.
proot-distro list
You should see entries like debian, ubuntu, etc. The debian entry points to the latest stable release.
proot-distro install debian
This command downloads a compressed root filesystem (≈150 MB) and extracts it under ~/.local/share/proot-distro/installed/debian. The download time depends on your connection.
proot-distro login debian
You will be dropped into a Debian prompt that looks like root@debian:/#. You are now operating inside a full Debian userland, but still confined to Termux’s sandbox.
At this point you have a minimal Debian system. Let’s perform the essential setup so you can install regular packages and, optionally, a lightweight desktop.
apt update
apt upgrade -y
android:adduser android
Follow the prompts to set a password and optional info. When done, switch to the new user:
su - android
apt install -y xfce4 xfce4-terminal tightvncserver dbus-x11
After installation, run vncserver once to set a VNC password and create the initial configuration files.
While you can stay inside proot-distro login debian, you may want to run a single command without entering an interactive shell. Use the exec sub‑command:
proot-distro exec debian -- ls -l /
This runs ls -l / inside Debian and returns to the Termux prompt.
Termux can forward X11 applications to an Android X server such as XServer XSDL. Below is a concise workflow.
0) and the TCP port (e.g., 6000).DISPLAY variable to point to the XServer:export DISPLAY=127.0.0.1:0
If you are using a VNC server instead, you can connect with a VNC client on Android (e.g., VNC Viewer) to 127.0.0.1:5901 after starting vncserver :1.
xclock:apt install -y x11-apps
xclock
The clock should appear on the XServer window.
All files you create inside the Debian rootfs are stored under Termux’s internal storage, so they survive reboots and Termux restarts. However, the proot-distro login command always boots a fresh session. To keep your environment consistent:
~/.local/share/proot-distro/installed/debian unless you intend to reinstall.installed/debian directory to external storage or cloud.proot-distro login debianapt update && apt full-upgrade -y
Because the rootfs is just a set of files, the upgrade works exactly like on a regular PC.
proot-distro fails to download the imagePossible causes:
Settings > Network & internet > Data Saver.Solution: Run pkg install wget and manually download the Debian tarball from GitHub releases, then place it in ~/.local/share/proot-distro/archives and retry proot-distro install debian.
Android restricts network access to the loopback interface for non‑system apps. Ensure you grant Termux the Display over other apps permission (required for XServer XSDL). Also, set DISPLAY exactly as shown; using :0 instead of 127.0.0.1:0 can cause the app to try the wrong address.
Termux runs in a constrained memory environment. If you notice OOM (out‑of‑memory) kills, consider:
~/.termux/termux.properties (add extra-keys = ... – not directly related, but you can also enable allow-external-apps = true to let Termux use more RAM).lxde instead of xfce4).apt reports missing GPG keysSometimes the Debian repository keys are not present in the minimal rootfs. Fix it by reinstalling the debian-archive-keyring package:
apt install --reinstall debian-archive-keyring
Then run apt update again.
pkg update && pkg upgrade -y regularly to receive security fixes for the underlying utilities.tar -czvf debian-backup.tar.gz / inside the Debian shell and copy the archive to external storage.With Debian running on your Android device you can:
nginx, postgresql, or python scripts without a separate laptop.curl, ssh) while staying offline.All of this is achieved without rooting, flashing, or voiding warranties—just a few minutes of setup and a willingness to type a few commands.









