How to Install Linux on Android

And although Android is based on the Linux kernel, the mobile OS lacks a number of important functions of its “progenitor”. Fortunately, a full-fledged distribution can be installed on smartphones and tablets. And in this article, we will tell you how to do this.

Why install Linux on Android?

Some Linux users may need it on their Android device to perform specific tasks:

  • Using command line tools (SSH, Git, compilers);
  • Launching a server environment for web development or testing;
  • A complete working environment for programming and working with texts;
  • Virtualization of systems for software testing;
  • Using a mobile device as a server.

There are several installation methods, each with its own advantages and limitations.

Installing Linux Without Root Access

This method allows you to run Linux in a virtual environment without having to make changes to the Android system. Works with containerization and emulation.

  • UserLAnd is one of the most convenient applications that supports the installation of Ubuntu, Debian, Kali and other distributions. Allows you to work via SSH or VNC;
  • AnLinux – uses Termux and PRoot to run distributions in a container. Ubuntu, Fedora, Arch Linux are available;
  • Termux is a terminal for Android that supports the installation of various packages, including a Linux environment without a graphical interface.

Installing UserLAnd

The UserLAnd application allows you to run Linux on Android without root rights. It creates a virtual environment in which you can use Ubuntu, Debian, Arch Linux and other distributions. You can work with the system via a terminal (SSH) or a graphical interface (VNC).

 

Step-by-step installation of UserLAnd:

  • Open Google Play, search for UserLAnd and install it;
  • Launch the application and select the desired distribution, for example Ubuntu;
  • In the window that appears, enter the username and password that will be used in the system;
  • Select a connection method: SSH for the command line or VNC for the graphical interface;
  • Wait for the necessary files to download and install (the process may take several minutes depending on your Internet speed);
  • Once the installation is complete, your installed distribution will appear in the list;
  • If SSH is selected, simply click on the distro and a Linux terminal will open;
  • If VNC is selected, install the VNC Viewer application, create a new connection with the address localhost:5951 and log in to the Linux graphical environment.

Installing AnLinux

AnLinux app allows you to run Linux on Android without root rights using Termux and PRoot technology. It supports Ubuntu, Debian, Arch Linux, Fedora and other distributions, working through a terminal or a graphical interface (VNC).

Step by step installation of AnLinux:

  • Open Google Play, search for AnLinux and install it;
  • Install Termux if it is not already installed;
  • Launch AnLinux and select the desired distribution, for example Ubuntu;
  • Go to the “Copy” section, copy the suggested installation command;
  • Open Termux, paste the command and execute it by pressing Enter;
  • Wait for the system to download and install (this may take several minutes);
  • After the installation is complete, start Linux using the command suggested by AnLinux;
  • If SSH is selected, work in the terminal via Termux;
  • If you need VNC, install VNC Viewer, in AnLinux select “Desktop Environment”, copy the launch command and run it in Termux, then connect to localhost:5901.

Installing Termux

Termux is a powerful terminal for Android that lets you run a Linux environment without root rights. You can install packages, work with the command line, and even run full-fledged distributions like Ubuntu or Debian.

Step by step installation of Termux:

  • Open Google Play, search for Termux and install it;
  • Launch Termux and wait for the necessary components to load;
  • Update the system with the command pkg update && pkg upgrade -y;
  • Install the base packages with the pkg install proot-distro command;
  • Run the installation of the selected distribution, for example Ubuntu, with the command proot-distro install ubuntu;
  • After installation, start the system with the command proot-distro login ubuntu;
  • Install additional packages with apt install if required;If you need a graphical interface, install VNC Viewer and set up the desktop environment with apt install xfce4 tigervnc-standalone-server;
  • Start the VNC server with the vncserver command and connect via VNC Viewer to localhost:5901. 

Installing Linux via chroot (root access required)

This method allows you to create a full-fledged Linux environment in the device’s file system, requiring root access.

  • Linux Deploy is one of the most popular chroot installation applications that allows you to deploy Ubuntu, Kali, Debian and other distributions;
  • Debian Noroot is an option for users who do not want root access but still need a basic Debian environment.

Installing Linux Deploy 

Linux Deploy is a powerful app that allows you to deploy a full-fledged Linux distribution on your Android device. Unlike other methods, it requires root access, but it provides better performance and deep system integration.

Step by step installation of Linux Deploy:

  • Download Linux Deploy and install it;
  • Make sure your device has root access, otherwise the installation will not work;
  • Run Linux Deploy and grant it root rights;
  • Click the Options button (gear icon) and select a distribution, such as Ubuntu;
  • Configure system settings – select architecture, file system and installation location (usually /data);
  • If necessary, specify the desktop environment (for example, XFCE or LXDE if you want a graphical interface);
  • Save the settings and click the Install button, then wait for the system to complete downloading and deployment;
  • After installation, click “Run” to activate Linux;
  • If using SSH, connect via terminal or any SSH client to localhost:22;
  • If VNC is configured, install VNC Viewer, connect to localhost:5900 and enter the Linux graphical environment.

Installing Debian Noroot

Debian Noroot is a simple solution for running Debian on Android without root access. Unlike other methods, it is not an emulation or a container, but a full-fledged Debian environment running on top of Android.

Step by step installation of Debian Noroot:

  • Open Google Play, search for Debian Noroot and install it;
  • Launch the application and wait for the necessary files to download;
  • Once the download is complete, the Debian desktop with the LXDE environment will open;
  • The system may operate slowly when first started – please wait a few minutes for the initial setup to complete;
  • To use the terminal, open LXTerminal from the applications menu;
  • Install the required programs using the apt install command;
  • If you need a Russian keyboard layout, configure it in the LXDE settings;
  • To exit, simply close the application – the system will restore the previous state the next time you launch it.

Now you have a full-fledged Debian environment available directly on Android without root access!

Full Linux Installation Instead of Android

For those who want to completely replace Android with Linux, there are special distributions designed for mobile devices.

  • Ubuntu Touch is a version of Ubuntu for mobile devices with touch support;
  • PostmarketOS is a lightweight Linux system designed for long-term support of older smartphones;
  • Kali NetHunter is a modified version of Kali Linux for security professionals.

Installing Ubuntu Touch 

Ubuntu Touch is a full-fledged mobile version of Linux developed by the UBports project. Unlike container solutions such as UserLAnd or Termux, Ubuntu Touch replaces Android and turns the device into a full-fledged Linux smartphone with a touch interface.

  • Go to devices.ubuntu-touch.io and check if your device is supported;
  • If your device is compatible, download and install UBports Installer on your computer (available for Windows, macOS, and Linux);
  • Connect your smartphone to your computer via USB cable and run UBports Installer;
  • Select the device model from the list if it is not detected automatically;
  • Select the version of Ubuntu Touch (usually the latest stable one is recommended) and click “Install”;
  • Follow the on-screen instructions: you may need to put your smartphone into Fastboot mode (usually by holding down the Volume and Power buttons while booting);
  • Wait until the installation is complete – the system will automatically boot on the device;
  • Go through the initial setup by selecting your language, Wi-Fi network, and other settings;
  • If you need a terminal, open the Terminal application from the menu;
  • To install additional programs, use OpenStore, the official Ubuntu Touch application store.

Installing PostmarketOS

PostmarketOS is a lightweight and modular Linux distribution designed specifically for smartphones. Unlike Ubuntu Touch, it is not focused only on mobile devices, but provides a full-fledged Linux environment. postmarketOS allows you to turn old or incompatible Android smartphones into working devices with long-term support.

Step by step installation of PostmarketOS:

  • Please visit postmarketos.org and check if your device is supported;
  • If your device is compatible, download and install pmbootstrap on your computer (Linux/macOS/WSL on Windows);
  • Open terminal and install pmbootstrap with pip3 install –user pmbootstrap;
  • Initialize the installation process with the pmbootstrap init command, follow the on-screen instructions;
  • Select a device from the list of supported ones or try the Generic option for experimentation;
  • Select a graphical environment (e.g. Plasma Mobile, Phosh, XFCE or leave only console mode);
  • Build the system with the pmbootstrap install command;
  • Connect your smartphone to the PC in Fastboot or Recovery mode, depending on the model;
  • The firmware can be installed directly (pmbootstrap flasher flash_rootfs) or an image can be created to boot from an SD card;
  • Once the installation is complete, boot the device into postmarketOS and perform the initial setup;
  • If a terminal is required, log in and use apk add to install packages.

Installing Kali NetHunter 

Kali NetHunter is a mobile version of the Kali Linux distribution designed for security testing and ethical hacking. It offers powerful tools for pentesting and network analysis, running on Android devices. Unlike container solutions such as Termux or UserLAnd, NetHunter provides deep access to the system, but requires root rights.

Step by step installation of Kali NetHunter:

  • Open nethunter.com and download the version suitable for your device;
  • If you don’t have root rights, choose NetHunter Rootless (limited functionality), if you do, choose NetHunter Lite or NetHunter Full;
  • Make sure that Magisk is installed on your device (if you choose the full version);
  • Install Termux from Google Play and update the system with the command pkg update && pkg upgrade -y;
  • Download the NetHunter installation script with wget -O install-nethunter.sh https://offs.ec/2MceZWr;
  • Run the installation with the bash install-nethunter.sh command and follow the on-screen instructions;
  • Once installed, launch Kali NetHunter with the nethunter command (or nethunter kex for the GUI);
  • If VNC is required, install VNC Viewer, start the server in NetHunter (nethunter kex start) and connect to localhost:5901;
  • To work with Wi-Fi adapters and USB devices, set up a chroot environment via NetHunter App Store;
  • Launch Kali Linux terminal and use tools (airmon-ng, nmap, metasploit, hydra and others)

Leave a Comment

Scroll to Top