The phone in your pocket can do much more than just run Android. And, if you’re reading this, you probably are looking for ways to run Linux on Android.
Linux is an open-source operating system and is free to use. Android is based on the Linux kernel. But what if you want to re-purpose your Android mobile to run Linux for a more complete desktop experience?
For that, you’ll need to install Linux on your Android phone. And in this article, we’re going to do just that. After you go through the various steps of installing Linux on your Android device, I’ll also state a few reasons why this could be advantageous to you.
Let’s get started.
Pre-Requisite to Get Started
The first step is to check whether your tablet or phone device can run Linux. In most cases, your device can run Linux. However, the approach to making Linux work on Android devices may differ depending on your Android device’s root status.
As for hardware capability, all modern devices, including phones or tablets, can run Linux due to its low hardware requirement and customizability. However, you need a rooted Android device (jailbroken) if you want complete control over device resources. If not, you can still install Linux with the help of Android apps such as Andronix, UserLAnd, or Debian Noroot.
Installing Linux Without Root
If your phone device is not jailbroken, you can use the apps to get Linux running on your phone.
The best way to get Linux is to use AndroNix, Termux, and VNC Viewer.
AndroNix is a popular Android app that lets you install Linux on Android. You can use it to install Linux at no cost.
Termux, on the other hand, is a powerful terminal emulation that gives you access to bash and zsh shells. Lastly, we have a VNC viewer, which we’ll need to connect to our Linux session.
Let’s go through the process of installing Linux without root.
Step 1: Pre-Requisite (Optional)
Before you get started, you need an Android tablet or phone. However, connecting your device to an external monitor, keyboard, and mouse is best to ensure optimal ease of use.
I will use my Samsung FE 21 5G Android phone for this tutorial. Samsung is known to provide an excellent ecosystem. It offers access to Samsung Dex, which lets you multitask between devices. Once you connect your modern Samsung phone to a computer, you get a working environment like a PC.
First, download Samsung Dex on your Windows machine and then connect the phone to the PC using a USB cable.
Once done, you’ll see a desktop-like UI directly on your PC.
But what if you don’t have access to a Samsung device? In that case, you can still connect wired or wirelessly.
You’ll need an OTG adapter and a USB hub to connect using wires. With this, you’ll get access to multiple USB ports necessary to connect your wired mouse and keyboard.
If you have a wireless keyboard and mouse, you can connect them with Bluetooth.
Note: This step is entirely optional. But, if you work with Linux on an Android device, it is best to set up a keyboard and mouse to improve usability.
Step 2: Install AndroNix, Termux, and VNC Viewer
This step includes installing three apps on your Android device. Go to their respective Play Store page and install them.
Note: If your smartphone doesn’t support these apps, you can go directly to their official page to download their .apk file and install it. In my case, Samsung didn’t support Termux, so I went to the Termux official site, downloaded the official .apk file, and installed it.
Step 3: Open Andronix and Install Your Favorite Linux Distribution
Once you open Andronix, you’ll see the following screen.
From here, you can click on Linux Distribution and see a list of supported distros. These include:
- Ubuntu
- Manjaro
- Debian
- Kali Linux
- Fedora
- Void
- Alpine
- Arch Linux
All of these distros are official and not modified. For this tutorial, we’re going to install Ubuntu.
So, click on Ubuntu, and it’ll ask you to select GUI.
Here, select Desktop Environment, and it’ll then redirect you window where you need to choose from the available desktop environments, including XFCE, LXQT, and LXDE. You can select any of the available options. We’ll use XFCE for this tutorial as it is lightweight and can run on low system resources.
As soon as you click Next, it’ll copy a command.
For our selection of options, it copied the following command for us.
pkg update -y && pkg install wget curl proot tar -y && wget https://raw.githubusercontent.com/AndronixApp/AndronixOrigin/master/Installer/Ubuntu22/ubuntu22-xfce.sh -O ubuntu22-xfce.sh && chmod +x ubuntu22-xfce.sh && bash ubuntu22-xfce.sh
Note: The code for your deployment might differ depending on your choices.
Step 4: Using Termux to Run the Command
You can open Termux by clicking on “Open Termux“.
Now paste the command in the terminal and press ENTER.
Note: You can press the “middle” mouse button to paste the command. You also need your phone device to be connected to the internet to download the necessary files.
It’ll start downloading the necessary file, and you might have to wait a few minutes for it to complete.
Note: During the installation, you’ll get various prompts. For all of them, press Enter to proceed. The installation will also prompt you to give Termux file permission. Allow it.
During the final stages of the installation, the prompt will ask you to select language, keyboard layout, and font package.
Please wait until it asks you to enter a new VNC password. We’ll come back to it later on.
Step 5: Creating a VNC Session
Open RealVNC Viewer and press on + to create a new VNC session. Now enter the address as “localhost:1” and the Name you like.
Step 6: Go Back to Termus and Finish the Installation
Now, add a new VNC password.
Once you do, you’ll see the AndroNix VNCserver resolution selection. Here, you can select any option based on your liking. For this tutorial, let’s choose the resolution as HD-ready.
And you’ll see your Ubuntu terminal! Run the following command to check yourself.
$ lsb_release -a
Step 7: Run the Ubuntu Desktop Environment
To run Ubuntu’s desktop environment, return to RealVNC Viewer, open Ubuntu, and click “Connect“.
Note: It’ll prompt you about an unencrypted connection. Just click on Continue.
Now, enter the VNC password you set above.
That’s it! You have installed Linux on an Android device.
And this is how it looks on your phone.
And, if you’ve rooted your device already, installing Linux on it is quite easy.
Installing Linux with Root
If you have a jailbroken Android device, you can deploy Linux by following the steps below.
Step 1: Install BusyBox on your phone. This will give you better control over root settings.
Step 2: Install any of these three apps, UserLAnd, AnLinux, or LinuxDeploy. These apps will help you deploy the Linux distro.
Step 3: Once you have installed the app of your choice (for this purpose, let’s use LinuxDeploy), run it. Also, make sure that it has root permissions enabled.
Step 4: Go to the bottom-right of LinuxDeploy and tap Settings.
Step 5: Here, select the distro of your choice. You can choose from Ubuntu, Fedora, Debian, etc.
Step 6: Under GUI, check the Enable box.
Step 7: Under Graphics, select VNC.
Step 8: It’ll then ask which GUI Setting you want. Choose a Desktop environment.
Step 9: Enter your name and password.
Step 10: Go to the upper-right corner, and exit the menu.
Step 11: Select Install, and then tap on OK.
From here, you’ll need to open RealVNC Viewer and then deploy a session (similar to how we did in the “Installing Linux without root Step 4“). However, you’ll need to enter the address as localhost:5900.
Once done, connect to the instance and enter your Linux Desktop with the credentials you entered in Step 9.
Awesome! You have successfully installed Linux on a rooted Android device.
You can also use various apps, if you find the steps shown above to be a bit cumbersome.
Using Apps
The Android ecosystem gives you access to plenty of apps to run Linux on Android tablets or phones. Let’s list a few of them below.
Andronix
Andronix lets you install Linux on Android more intuitively. It works excellently on non-rooted devices. And the best part is that it is free to use due to its open-source license.
Out of the box, you can use it to install 8 official Linux distributions. Earlier, we used Andronix to install Ubuntu.
In addition to the free Linux distro distributions, it offers paid Andronix Modded OS. These are optimized for Android devices, providing better stability and customizability. You can also get Andronix Premium with additional features such as offline installation, command, etc.
UserLAnd
UserLAnd is a useful open-source app that lets you run a Linux distro on Android. Just like Andronix, it works on non-rooted devices. It offers a built-in terminal with support for different shells. Additionally, you can connect to VNC to enable the graphics interface.
AnLinux
AnLinux is a helpful app to run Linux on Android. It utilizes PRoot and Termux so that you can run the Xfce desktop environment and SSH. Similar to UserLAnd and Andronix, it doesn’t require root access.
You can use it to run multiple distros without any conflict.
AndroLinux
AnrdoLinux is an open-source operating system using a GNOME desktop environment. This package gives you a complete Linux desktop experience on your Android device.
Under the hood, AndroLinux is based on CentOS and Fedora. It also offers good security.
You can use AndroLinux to set up a professional environment, as it can run Office apps, illustrations, and designs.
Termux
Termux gives you access to a powerful terminal without installing third-party files or services. Once you install it, you get access to bash and zsh shells. After all, Android uses a Linux kernel, and hence it can build on top of it.
You can use Termux to install Linux distros, access servers over ssh, manage files, run text-based games, etc.
Now that you’ve seen the various ways in which you can run Linux on your Android device, let’s understand how this can be beneficial to you.
Reasons to Run Linux on Android Devices
There are plenty of benefits when running Linux on your Android device.
You Want a Tiny and Affordable Computer/Desktop Experience
Smartphones are more powerful than you can think of. Even an old Android device holds enough computational power to easily run a Linux operating system (Linux being lightweight also helps).
So, if you want an affordable Linux-powered device, you can install Linux on Android and use it in your daily activities. Even though this setup could be more optimal, it does give many users out there the option to achieve something.
After all, a mobile device runs Android, a Linux kernel capable of interacting with the underlying mobile phone hardware. Also, plenty of easy-to-use and lightweight Linux distros are out there, including Ubuntu, Gentoo, and even Arch Linux.
You Want to Experiment
Technology in your hands is not just to watch TikTok or Instagram mindlessly. It also opens up the path to experimentation. So, if you like to experiment, you can use a mobile device with Linux to do many things. For example, you can do the following:
- Install and run web server using Nginx.
- Use the device as a hacking tool by installing Kali Linux
- Use it as an educational tool-box by learning about Linux
- Run a 24/7 low-powered torrent device to share files
- Run a local network Adblocker to block ads on your local wireless
These are just a few use cases of what you can do by running Linux on an Android device.
You Want To Try Out Different Linux Flavors
You can also use an Android-powered mobile device to try different Linux distros.
Final Words
Running Linux on Android is fun. It is a cool experiment you can run on weekends.
The best part about Linux on Android is that Android itself uses a Linux kernel. That means vast support for Android apps that can let you install and try different Linux distros. Furthermore, rooting your device to use Linux on an Android device is unnecessary. A jailbroken device gives you more freedom when configuring and using Linux on an Android device.