termux-nethunter

Install Kali NetHunter Rootless on Android.

View on GitHub

TERMUX NETHUNTER

Image could not be loaded!

Are you a Linux enthusiast, or do you enjoy experimenting with the terminal and running commands to feel like a tech genius? Well, whatever your reason for wanting to install Linux on your phone, I’ve got you covered.

Installing Linux on your phone might not make you a hacker, but it will certainly make you look and feel like one.

With this guide, you will be able to run a full Linux system, including every Linux command you can think of, and install different PC software—all on your phone! That’s not all—you can run a desktop environment, enjoy a PC-like graphical interface, and perhaps feel like a hacker from a movie.

Did I mention that you do not require root access to do all this? All you have to do is follow these simple installation instructions, and you are a few keystrokes away from running all the cool programs created by the Linux community.

Contents

Installation

How to Install

Download and install the Termux app on your phone, then open it and execute the following commands.

  1. Upgrade Termux packages
pkg update && pkg upgrade
  1. Install curl
pkg install curl
  1. Download the install script
curl -fsSLO https://raw.githubusercontent.com/jorexdeveloper/termux-nethunter/main/install-nethunter.sh
  1. Execute the install script
bash install-nethunter.sh

You can also customize the installation with command-line options (See bash install-ubuntu.sh --help for more information).

It’s probably a good idea to inspect any install script from projects you don’t yet know. You can do that by downloading the install script, looking through it to ensure everything looks fine before running it.

If you are lazy like me, you can just copy and paste the commands below in Termux.

pkg update -y && pkg upgrade -y && pkg install -y curl && curl -fsSLO https://raw.githubusercontent.com/jorexdeveloper/termux-nethunter/main/install-nethunter.sh && bash install-nethunter.sh

Launch and Set Up

After successful installation, you need to launch the system and make a few setups.

How to Launch

Launch the system by simply executing the following command.

nethunter

or with a shorter version

nh

You will be logged in with the default username, kali (You can log in as another user by providing their username as an argument.)

See nethunter --help for usage information.

How to Set Up the Desktop

For the minimal and nano installations, you will need to install a desktop environment and a VNC server to get a graphical interface to interact with.

Launch the system and execute the following commands.

  1. Upgrade system packages
sudo apt update && apt full-upgrade
  1. Install VNC server
sudo apt install tigervnc-standalone-server dbus-x11
  1. Install desktop environment
sudo apt install kali-desktop-xfce

This command will not only take several gigabytes of your storage but also take a while to complete. Grab a coffee and ensure that Termux remains open during the installation to avoid potential issues (You can also acquire Termux wake lock, but it will only work if battery optimization is disabled).

Login

Now all that’s left is to log in to your newly installed system and start playing around with some commands. To do that, you need to start a VNC server in the system and connect to it through a VNC viewer.

How to Start the Desktop

Launch the system and execute the following command.

vnc

Use vnc kill to stop the VNC server and terminate the Desktop session. (See vnc help for more information).

On the first run of the command above, you will be prompted for a VNC password. This is the password that will be used to securely connect to the VNC server in the VNC viewer app, so save it somewhere.

How to Connect to the Desktop

To connect to the VNC server and view the desktop, you will need to download and install a VNC viewer app of your choice (I recommend AVNC).

Start the desktop and minimize Termux.

Then open the VNC viewer app, click add server, and fill in the following details:

Name

Kali Desktop

Host

localhost

Port

username port
kali 5900 (works for all users)

Password

Enter the VNC password you set when starting the desktop for the first time.

Have Fun

If you managed to get this far without any problems, congratulations! Linux is now installed on your phone, and it’s time to explore and have some fun with it!

The possibilities are endless, and the only limits that exist are the ones you set for yourself.

You might want to Google some cool commands and programs to execute or even when you get stuck. Good luck.

Management

A few features have been added to the nethunter command to simplify some tasks.

How to Rename

Renaming the installed system is far more complicated than just executing a regular mv command.

To rename your installation, execute the following command:

nethunter --rename <new-directory>

How to Backup

Backing up the installed system is far more complicated than just executing an ordinary tar command.

To back up your installation, execute the following command:

nethunter --backup <archive-name> [<dirs-to-exclude>]

The backup is performed as a TAR archive and compression is determined by the output file extension.

How to Restore

To restore your backed-up installation from the archive, execute the following command:

nethunter --restore <archive-name>

The rootfs MUST be restored to the original location but you can rename it afterwards.

How to Uninstall

To uninstall the system, just execute the following command:

nethunter --uninstall

FAQ

If you encountered some hiccups during the installation or have some burning questions, you are probably not the first one. Feel free to document them in the issues section.

However, a few frequently asked questions have been answered below.

What happens if Termux has root access?

This guide assumes that Termux has no root access and the only root permissions that exist are those simulated in the installed system.

However, if you have tried following the steps above with root permissions in Termux, then you have probably not succeeded because installing and running the system with root permissions in Termux can have unintended effects and should never be done (unless you are sure of what you are doing); otherwise, you might end up damaging your device.

For that reason, I added a safety check to the install script that terminates the installation process if Termux has root access.

There should not be a good enough reason to launch the system when Termux has root permissions because harmless root privileges are still simulated in the system with the help of proot.

Workaround

If you don’t mind damaging your device (probably making it unusable) and are ready to get your hands dirty, this section might resonate.

Disabling the safety check will require a deeper understanding of the install script and the installation process. You will need to edit the install script as follows:

Not very helpful, is it? That’s because this is definitely a bad idea, and you are completely liable for any unintended effects of this action.

Just remember, I am mostly lazy and would never implement a safety check for no reason.

Contribution

Contributions to this project are not only welcome but also encouraged.

Here is the current TODO list:

License

    Copyright (C) 2023-2025  Jore

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.