Install a Full Linux Distribution on Android Using Termux and Proot (No Root)

10 min read Step‑by‑step guide to run Ubuntu (or another Linux distro) inside Termux on Android without rooting, with optional GUI via XServer XSDL. October 07, 2026 08:30 How to Install a Full Linux Distribution on Android Using Termux and Proot (No Root)

Problem: You want a real Linux shell – maybe even a desktop – on your Android phone, but you cannot or do not want to root the device.

Termux is an Android terminal emulator that runs a minimal Linux userland. By pairing it with proot-distro, you can launch a complete distribution (Ubuntu, Debian, Alpine, etc.) inside a confined environment. No root privileges are required because proot emulates the necessary system calls.

Before you start

  • Android 7.0 (Nougat) or newer – older versions lack the required SELinux permissions.
  • At least 2 GB of free internal storage. A full Ubuntu install occupies ~1 GB; give yourself some headroom for packages and files.
  • Stable Wi‑Fi or mobile data connection for downloading packages (≈300 MB for Ubuntu).
  • Battery level above 50 % or keep the device plugged in during the installation.
  • Optional: If you want a graphical desktop, install XServer XSDL from the Play Store.

Step 1 – Install Termux

  1. Open the Google Play Store (or F-Droid for the open‑source build).
  2. Search for Termux and tap Install.
  3. After installation, launch Termux. The first launch will initialize the environment and ask you to grant storage permission. Accept it.

Why this matters: Termux provides the apt package manager and a sandboxed Linux userland that we will extend with a full distro.

Step 2 – Update Termux and install required packages

  1. Update the package repository and upgrade existing packages:
    apt update && apt upgrade -y
  2. Install proot-distro and a few helper tools:
    apt install -y proot-distro wget curl git
  3. Verify the installation:
    proot-distro --help
    You should see a usage summary.

These packages are the backbone: proot-distro downloads and launches the Linux rootfs, while wget and curl help fetch additional files.

Step 3 – Choose and download a Linux distribution

proot-distro ships with ready‑made rootfs for several popular distros. For this tutorial we’ll use Ubuntu 22.04 LTS, but you can replace ubuntu-22.04 with debian, alpine, etc.

  1. List available distros:
    proot-distro list
  2. Install Ubuntu 22.04:
    proot-distro install ubuntu-22.04
    The script downloads a ~300 MB tarball, extracts it, and registers the distro under the name ubuntu-22.04.

During download you’ll see a progress bar. If the connection drops, simply re‑run the same command – it will resume.

Step 4 – Launch the Linux environment

  1. Start Ubuntu:
    proot-distro login ubuntu-22.04
  2. You are now inside a regular Ubuntu shell (prompt changes to root@ubuntu:/#).
  3. Update Ubuntu’s package lists and upgrade:
    apt update && apt upgrade -y

Why you see root: The proot environment runs as the unprivileged Termux user, but it pretends to be root inside the distro. This is safe because it never gains real root on Android.

Step 5 – Basic Linux usage inside Termux

Now you have a fully functional Ubuntu system. Here are a few common tasks:

  • Installing packages: apt install git vim htop
  • Accessing Android storage: The directory /data/data/com.termux/files/home/storage is mounted inside Ubuntu as /root/storage. You can read/write to your shared storage from Linux.
    ls /root/storage/downloads
  • Running Python scripts: Install Python with apt install python3 and execute scripts just like on a PC.

Step 6 – Optional: Set up a graphical desktop (XServer XSDL)

If you need a GUI – for example a lightweight desktop like LXDE – follow these extra steps.

  1. Install XServer XSDL from the Play Store and launch it. It will display a message like Display number: 0 and a TCP address (usually 127.0.0.1:0).
  2. Back in the Ubuntu shell, install a minimal desktop and X11 utilities:
    apt install -y lxde-core lxterminal xauth xinit
  3. Set the DISPLAY environment variable to point to XSDL:
    export DISPLAY=127.0.0.1:0
  4. Start the desktop:
    startlxde &
    The desktop should appear inside the XSDL window.

Note: XSDL runs in a separate Android app, so the performance is modest. For occasional GUI tools (e.g., gedit or gparted) it works well.

Step 7 – Persisting changes and returning later

The Linux rootfs lives inside Termux’s private data directory. To exit the distro, simply type exit or press Ctrl‑D. The next time you want to continue, run the same proot-distro login ubuntu-22.04 command – all installed packages and files remain intact.

Step 8 – Managing multiple distros

You can install more than one distribution side‑by‑side. For example:

proot-distro install debian

Each distro gets its own name; use proot-distro login debian to switch.

Troubleshooting

1. “Failed to download rootfs”

  • Check your internet connection.
  • Make sure Termux has storage permission (Settings → Apps → Termux → Permissions).
  • If the server is temporarily unreachable, wait a few minutes and retry.

2. “proot: cannot setuid” or “permission denied”

This usually means SELinux is enforcing a policy that blocks the bind‑mount. The fix is to enable the allow‑external‑storage option in Termux:

termux-setup-storage

Then restart Termux and try again.

3. GUI shows a black screen

  • Confirm that XServer XSDL is running before you launch startlxde.
  • Make sure the DISPLAY variable matches the address shown by XSDL (sometimes it’s 127.0.0.1:0, other times :0).
  • If you see “cannot open display”, install xauth inside Ubuntu and run xhost + in the XSDL terminal.

4. “No space left on device”

Termux’s internal storage is limited on devices with low internal memory. You can move the distro to external SD card (if your device supports it) by creating a symbolic link:

mkdir -p /sdcard/termux-distros
ln -s /sdcard/termux-distros $HOME/.local/share/proot-distro

After moving, reinstall the distro or copy the existing rootfs folder into the new location.

Safety warnings

  • Never run sudo or attempt to install a real root bootloader inside the proot environment – it has no effect and can confuse scripts.
  • Be mindful of storage consumption: large package installations (e.g., full desktop environments) can quickly fill your device.
  • Running network services (SSH, web server) inside the distro exposes ports on the Android network interface. Use strong passwords or key‑based auth, and consider disabling the service when not needed.

What you can do now

With a working Linux distro on your phone you can:

  • Compile small C programs on the go.
  • Run command‑line tools like ffmpeg, git, or htop.
  • Set up a portable development environment for Python, Node.js, or Rust.
  • Use a lightweight GUI for note‑taking, file management, or learning Linux basics.

All of this without ever rooting your device, preserving the warranty and the security model Android provides.

Enjoy your new Android‑based Linux workstation!

User Comments (0)

Add Comment
We'll never share your email with anyone else.