Save 10%Pay yearly on any plan. 6% half-yearly, 3% quarterly. Help centreWhatsAppTelegram TeamsOpen a ticket

AnLinux: How to Run Linux on an Android Phone Without Root

AnLinux and Termux put Ubuntu, Debian or Kali on an Android phone without rooting it. How it works, the steps, a desktop over VNC, and its limits.

3 min readBy Soumya

Reviewed by the AmazingRDP technical team

Running Linux on Android with AnLinux

Want a full Linux machine you can reach from your phone? Connect to a Linux VPS over SSH from Termux. See Linux VPS from $6.99

An Android phone runs on a Linux kernel, and with two free apps it can run a normal Linux distribution on top: Ubuntu, Debian, Kali and others, with their package managers and command-line tools. No rooting is needed, and Android itself stays untouched.

How it works

  • Termux is a terminal app for Android with its own small set of Linux tools.
  • AnLinux is a helper. You choose a distribution, and it gives you the one command that downloads and sets it up inside Termux.
  • The distribution runs through a tool called PRoot, which makes programs believe they are in a normal Linux system while they are really in a folder of the Termux app. That is why no root access is needed.

Set it up

  1. Install Termux. Its developers publish it on F-Droid and on GitHub; the old copy in the Play Store was not kept up to date for years, so follow the Termux project's own advice on where to get it.
  2. Install AnLinux.
  3. Open AnLinux, tap Choose, and pick a distribution, for example Ubuntu.
  4. Tap Copy to copy the command it shows, then Launch to open Termux.
  5. Paste the command into Termux (long-press, Paste) and press Enter. The download takes a few minutes.
  6. Start Linux with the script the command created:
./start-ubuntu.sh

The prompt changes: you are now inside Ubuntu. Update it and install what you need, as on any Ubuntu system:

apt update && apt upgrade
apt install python3 git nano

Leave with exit. Run the start script again whenever you want to return.

The same without AnLinux

Termux now has this built in, and many people skip the helper app:

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

A graphical desktop

AnLinux can also give you the commands for a desktop such as Xfce. The desktop runs inside the distribution, and you look at it with a VNC viewer app on the same phone, connected to localhost. It works, but a phone screen is small and the desktop is slow; a Bluetooth keyboard and an external screen make it bearable.

What it is good for

  • Learning the Linux command line anywhere.
  • Small scripts in Python, Bash or Node.js.
  • Git, SSH and text tools on the go.
  • Reaching your servers: ssh user@server works from Termux directly.

The limits

  • Speed. PRoot translates every file operation, so programs that touch many files, such as compilers and package installs, are several times slower than on a real system.
  • No services. There is no systemd, so things like Docker or a database set up as a service do not work the usual way.
  • No real root. You appear as root inside the distribution, but you cannot touch hardware or the network at a low level. Many security tools therefore do not work.
  • Android may stop it. Battery saving ends long-running background work. Termux has a "wake lock" option in its notification that helps.
  • Storage. A distribution with a desktop takes several gigabytes.

When you need the real thing

For a Linux system that runs day and night, has a public address and real root, rent a server and connect to it from Termux on your phone. Our Linux VPS plans come with root access. Related guides: copy and paste in Ubuntu Server, fix "sudo: command not found" in Linux and Home Assistant on a Pi Zero 2 W.

Questions

Do I need to root my phone for AnLinux?

No. Linux runs inside the Termux app through PRoot, which needs no root access.

Which Linux distributions can I run on Android?

Ubuntu, Debian, Kali, Fedora, Arch and others, depending on what AnLinux or proot-distro offers.

Can I run Docker in Linux on Android?

Not this way. There is no systemd and no access to the kernel features Docker needs.

Is it as fast as a real Linux PC?

No. Work that touches many files is several times slower.