Many people start learning cybersecurity on a laptop or desktop computer. But what if you only have an Android phone? That is where Termux and Kali NetHunter become very useful.
When I first discovered this setup, I was surprised by how powerful it is. With the right steps, you can run a Kali Linux environment directly inside Termux without rooting your phone. This means you can practice cybersecurity tools, learn Linux commands, and explore penetration testing concepts from your mobile device.
In this guide, I will show you how to install Kali NetHunter in Termux without root access. I will keep everything simple so even beginners can follow along.
What Is Kali Nethunter?
Kali NetHunter is a mobile penetration testing platform based on Kali Linux. It brings many of the tools from Kali Linux to Android devices.
Instead of installing Kali Linux directly on your phone, the rootless version runs inside a Linux environment created in Termux. This makes it much safer because it does not require modifying your Android system.
Another useful feature is NetHunter KeX, which allows you to run the Kali Linux desktop interface on your phone. This means you can use a graphical environment instead of only working in the terminal.
For people learning Linux or cybersecurity, this setup can turn a normal Android phone into a small portable lab.
What You Need Before Starting
Before installing Kali NetHunter, there are a few things you should prepare so the setup goes smoothly.
- First, install the latest version of Termux on your Android phone. It is recommended to download it from the F-Droid store because the Play Store version is outdated and may cause issues during installation.
- Next, install the Kali NetHunter App Store from the official NetHunter website. After installing the store, open it and search for NetHunter KeX, then install the application. NetHunter KeX is the tool that allows you to connect to the Kali Linux desktop environment later in this guide.
- You will also need a stable internet connection because the installation downloads several large files.
- Storage space is another important thing to consider. The full NetHunter environment can use around 2.5 GB of space after installation, so make sure your device has enough free storage before starting.
Once these things are ready, you can begin the installation process in Termux.
Step 1: Update Termux Packages
Whenever you start working with Termux, it is always a good idea to update the packages first.
Run the following command:
pkg update && pkg upgrade -y
This ensures your Termux environment is running the latest versions of all packages.
Step 2: Install Wget
Next, install the wget package. This tool will allow us to download the official NetHunter installer script.
pkg install wget -y
The installation only takes a few seconds.
Step 3: Grant Storage Permission
Now give Termux access to your device storage.
termux-setup-storage
You will see a permission request. Allow it so Termux can access files on your phone.
Step 4: Download the NetHunter Installer
Now download the official NetHunter installation script.
wget -O install-nethunter-termux https://offs.ec/2MceZWr
This script is provided by the Kali Linux team and handles the entire installation process.
Step 5: Make the Script Executable
Before running the script, you need to give it permission to execute.
chmod +x install-nethunter-termux
Step 6: Start the Installation
Now run the installer.
./install-nethunter-termux
The script will begin downloading the Kali NetHunter environment and setting everything up automatically.
This step takes the longest time because many packages need to be downloaded.
Depending on your internet speed, it may take around 20 to 30 minutes to complete.
Step 7: Choose the Full Version
During installation, the script will ask which version of NetHunter you want to install.
Choose option 1 to install the full version.
The download size is about 2.5 GB, so make sure you have enough data and storage space.
Step 8: Keep the Zip File
After installation, you’ll be prompted to remove the zip file. Type n to keep it as a backup.
Once this process is complete, Kali Nethunter will be installed on your device.
Access the Kali Linux Desktop on Android
After installing Kali NetHunter, you can also run the Kali Linux desktop environment on your Android phone. This is done using NetHunter KeX, which allows you to connect to a graphical Kali session instead of working only in the terminal.
Follow the steps below to access the Kali desktop on your device.
Step 1: Set a Password for NetHunter KeX
First, you need to create a password for the NetHunter KeX session. This password will be used when connecting to the Kali desktop from the KeX application.
Open Termux and run the following command:
nethunter kex passwd
You will be asked to enter a password and confirm it. Choose a password you can easily remember because you will need it when connecting to the desktop environment.
Once the password is set, you are ready to start the KeX session.
Step 2: Start the NetHunter Desktop Session
Now start the Kali NetHunter desktop session by running this command in Termux:
nethunter kex &
This command launches the NetHunter KeX server in the background. After running it, Termux will display the port number where the VNC session is running. In most cases the port will be 5901, but it is always a good idea to check the output.
Make a note of the port number because you will use it when connecting from the NetHunter KeX application.
Step 3: Open the NetHunter KeX Application
Next, open the NetHunter KeX app on your Android device.
In the connection settings, enter the port number shown in Termux. If the default session is used, the port will usually be 5901.
After that, enter the password you created earlier and tap Connect.
Important Note
Sometimes the port shown in Termux may be different from the default value
(:1). If that happens, make sure you enter the exact port number displayed
after running the nethunter kex & command.
Using the correct port ensures the NetHunter KeX app connects to the running
desktop session.
Within a few seconds, the Kali Linux desktop environment should appear on your screen. You will now have access to the Kali desktop, terminal, and file manager directly from your Android device.
Troubleshooting Common Issues
If the desktop environment fails to connect or applications stop working properly, the easiest solution is usually restarting the KeX server.
Run the following commands in Termux:
nethunter kex stop
nethunter kex &
This stops the current session and starts a new one. In most cases, this fixes connection or VNC related issues.
Fix Signal 9 Error in Android 12 or Higher
On some devices running Android 12 or newer, the NetHunter GUI may crash with a Signal 9 error. This happens because Android limits background processes through a feature called the Phantom Process Killer.
To fix this issue, you need to change a few system settings using ADB commands.
Start by enabling Developer Options on your phone. Go to Settings > About Phone and tap the Build Number seven times until Developer Options are enabled.
Next, open Developer Options and enable USB debugging.
Connect your Android phone to a computer that has ADB tools installed. Once connected, open a terminal or command prompt on your computer and run the following commands.
adb devices
adb shell "/system/bin/device_config set_sync_disabled_for_tests persistent"
adb shell "/system/bin/device_config put activity_manager max_phantom_processes 2147483647"
adb shell settings put global settings_enable_monitor_phantom_procs false
After applying the changes, you can verify them using these commands:
adb shell "/system/bin/dumpsys activity settings | grep max_phantom_processes"
adb shell "/system/bin/device_config get activity_manager max_phantom_processes"
Once everything is set correctly, restart the NetHunter desktop session in Termux:
nethunter kex &It is also recommended to disable battery optimization for Termux in your Android settings. This helps keep the NetHunter environment running more reliably.
Conclusion
Running Kali NetHunter in Termux gives you a simple way to use a Kali Linux environment on your Android phone without rooting your device. With the help of NetHunter KeX, you can even access the Kali Linux desktop interface and work with graphical tools, not just the terminal.
For anyone learning Linux or exploring cybersecurity tools, this setup can turn a normal smartphone into a small portable lab. You can practice commands, test different tools, and get more comfortable working inside a Linux environment wherever you are.
If you followed the steps in this guide, you should now have Kali NetHunter running smoothly on your device.
If you notice any mistakes in this tutorial or run into an issue during installation, feel free to leave a comment below so it can help others as well. And if you found this guide helpful, consider sharing it with someone who is learning Termux or cybersecurity.








