Running Ubuntu on Android does not require root, but it does need a few basic conditions. Satisfying them up front saves you from interruptions later.
termux-setup-storage).All commands below are typed inside Termux. If you see a # prompt, it means you are using the root user inside the Ubuntu chroot, not the Android system root.
pkg update && pkg upgrade -ypkg install proot-distro wget tar -yDo not run apt-get directly in Termux. Termux uses its own pkg front‑end; mixing Debian/Ubuntu commands with Termux can corrupt the environment.
termux-setup-storage
You will be asked to allow Termux to access your files. Accept the permission dialog.~/storage directory with symlinks to Downloads, DCIM, etc. This is where you can keep any Linux files you want to share with Android.proot-distroproot-distro is a lightweight wrapper that downloads a Linux root filesystem and runs it under proot, which emulates the required chroot/syscall environment without needing root privileges.
proot-distro listubuntu-20.04.
proot-distro install ubuntu-22.04
The script downloads a ~400 MB compressed rootfs, extracts it, and sets up a launch wrapper. Expect a few minutes of network and CPU activity.proot-distro login ubuntu-22.04
You should see a prompt that looks like root@localhost:~#. You are now inside Ubuntu.If you run out of space during download, you can change the download directory by setting the PROOT_DISTRIBUTION_ROOTFS_DIR environment variable before the install command.
At this point you have a bare Ubuntu system. It lacks the usual package lists and locales, so perform a quick setup.
apt update && apt upgrade -yapt install -y wget curl git vim sudoadduser androiduser
usermod -aG sudo androiduser
When prompted, set a password you can remember. You can then switch to this user with su - androiduser.apt install -y locales
locale-gen en_US.UTF-8
update-locale LANG=en_US.UTF-8Running a GUI makes the Ubuntu environment feel more like a traditional Linux PC. Android does not have an X server, so we use VNC to forward the display.
apt install -y xfce4 xfce4-terminal tigervnc-standalone-servervncpasswd~/.vnc/xstartup (replace nano with your editor of choice):
#!/bin/sh
xrdb $HOME/.Xresources
startxfce4 &
Make it executable:
chmod +x ~/.vnc/xstartup:1 with a resolution of 1280×720 (adjust as you like):
vncserver :1 -geometry 1280x720 -depth 24
You will see a line like New 'androiduser@hostname:1' desktop is androiduser@hostname:1. Keep note of the port number – VNC uses 5900 + display number, so this will be 5901.127.0.0.1:5901, and connect using the password you set earlier. You should now see the Xfce desktop running inside Ubuntu.Leaving the VNC server running consumes CPU and battery. When you are finished, stop it with vncserver -kill :1 inside Ubuntu.
If you only need command‑line tools, you can stay inside the terminal. Here are a few common tasks:
apt install package-nameapt install python3 python3-pip then pip3 install --user packagegit clone https://github.com/… – the cloned files will live inside the Ubuntu filesystem under /root or /home/androiduser./data/data/com.termux/files/home/storage. You can symlink a convenient folder:
ln -s /data/data/com.termux/files/home/storage/downloads ~/DownloadsThe Ubuntu rootfs lives inside Termux's private data directory (~/../usr/var/lib/proot-distro/installed/ubuntu-22.04). It is preserved as long as you do not uninstall Termux or clear its data. To back up the whole Linux environment:
exit or press Ctrl+D).tar -czvf ubuntu-backup.tar.gz -C $HOME/../usr/var/lib/proot-distro/installed/ubuntu-22.04 .mv or a file manager.To restore, extract the archive back into the same path and run proot-distro login ubuntu-22.04.
This usually means the downloaded rootfs is corrupted or the device’s architecture does not match the image (e.g., trying to run an x86_64 Ubuntu on an ARM64 phone). Verify the architecture with uname -m inside Termux. Use the matching distribution name, such as ubuntu-22.04-arm64 if available.
xstartup script is executable and contains the startxfce4 line.:1).127.0.0.1 fails, try localhost or the device’s local IP address (e.g., 192.168.1.42:5901) while both Termux and the VNC client are on the same Wi‑Fi network.Termux stores files on internal storage by default. If your internal partition is small, move the proot-distro root directory to an external SD card:
mkdir -p /sdcard/termux-proot
export PROOT_DISTRIBUTION_ROOTFS_DIR=/sdcard/termux-proot
proot-distro install ubuntu-22.04
Remember to update the PROOT_DISTRIBUTION_ROOTFS_DIR variable each time you start Termux (add the export line to ~/.bashrc).
VNC performance depends on the chosen encoding. In vncserver you can enable the Tight encoding for better speed:
vncserver :1 -geometry 1280x720 -depth 24 -SecurityTypes None -xstartup ~/.vnc/xstartup -rfbport 5901 -rfbwait 5000 -localhost no -tight
Alternatively, try a different VNC server such as tigervnc-standalone-server with the -SecurityTypes None flag if you are on a trusted private network.
Running a full Linux distro is CPU‑intensive. Here are some practical tips to keep the experience smooth:
systemd isn’t fully functional under proot, so services won’t start automatically).Even though the Linux environment runs in user space, treat it like any other machine:
root inside Ubuntu unless you understand the risk.ssh (install openssh in Ubuntu and forward the port)./storage is accessible to other apps, so keep sensitive data inside the Linux home directory.Now that Ubuntu is running, you can use it for a variety of tasks that would otherwise require a PC:
gcc or make.python -m http.server) and test web pages on the same device.ssh to connect to other machines, or run an ssh daemon to allow remote access to your phone’s Linux shell.Because the environment lives entirely in user space, you can uninstall it at any time without affecting the Android system: simply run proot-distro remove ubuntu-22.04 and delete the associated files.
By leveraging Termux and proot-distro, you can spin up a fully functional Ubuntu Linux installation on virtually any Android phone without rooting. The process consists of installing Termux, pulling the Ubuntu rootfs, performing a quick configuration, and optionally adding a VNC‑based desktop. With the troubleshooting tips and performance advice above, you should be able to keep the Linux environment stable, secure, and useful for development, testing, or just plain curiosity.









