How to Install Metasploit in Termux
A beginner-friendly introduction to running the Metasploit framework on an Android phone using Termux.

Many people begin learning cybersecurity using a laptop or desktop computer. That is the usual path. But today, smartphones are powerful enough to run many tools that were once limited to traditional computers.
If you use Android, one interesting option is Termux. Termux provides a Linux-like command line environment directly on your phone. With it, you can install packages, run scripts, and experiment with different development and security tools.
One tool that many learners become curious about is Metasploit.
Metasploit is widely known in the cybersecurity world and is commonly used in penetration testing labs and security training. What many beginners do not realize is that it can also run inside Termux with the right setup.
In this guide, we will walk through the basic steps required to install Metasploit in Termux and explain a few things you should know before starting.
What Is Metasploit?
Metasploit is a penetration testing framework used by security professionals and researchers. It helps them test systems for vulnerabilities and understand how certain weaknesses can be exploited.
Instead of writing complex code manually, Metasploit provides modules that automate many tasks. These modules allow researchers to simulate attacks in a controlled environment.
Common uses include testing system security, studying known vulnerabilities, and practicing penetration testing techniques in a lab environment.
It is important to remember that tools like this should only be used in legal environments, such as your own lab or systems where you have permission to perform testing.
For beginners who want to understand how vulnerabilities work, Metasploit is often one of the first frameworks they explore.
What Is Termux?
Termux is an Android application that provides a Linux-like terminal environment. It allows users to install many open-source packages and tools using a package manager similar to those found in Linux distributions.
With Termux, your Android phone can perform tasks such as:
- Running command line utilities
- Writing and testing scripts
- Installing programming languages
- Experimenting with development tools
Because of this flexibility, many learners use Termux as a portable environment for practicing Linux commands and learning technical tools.
Things to Know Before Installing
Before installing Metasploit in Termux, there are a few practical things to keep in mind.
First, the installation requires a stable internet connection. Many dependencies must be downloaded during the setup process.
Second, the installation may take some time. Since the framework includes many components, the setup process can take several minutes depending on your device.
Storage space is another factor. Metasploit and its dependencies require a noticeable amount of space, so it is a good idea to make sure your device has enough free storage before starting.
Finally, remember that running large frameworks on a smartphone may not be as fast as running them on a full computer. For learning purposes, however, the setup works surprisingly well.
Step 1: Update Termux Packages
Before installing any major tool in Termux, it is always a good idea to update the package list and upgrade existing packages.
Open Termux and run:
pkg update && pkg upgrade
This command ensures that your environment is using the latest available packages.
Keeping your system updated can also prevent many installation errors.
Step 2: Install Required Dependencies
Metasploit depends on several packages in order to work correctly. These packages provide tools and libraries that the framework needs during installation.
Install the required dependencies with the following command:
pkg install git wget curl ruby
These packages are commonly required during the installation process.
After the installation finishes, your Termux environment will be ready for the next step.
Step 3: Download the Metasploit Installation Script
One convenient way to install Metasploit in Termux is by using an installation script that prepares the framework automatically.
First, download the script:
curl -LO https://raw.githubusercontent.com/gushmazuko/metasploit_in_termux/master/metasploit.sh
Once the file finishes downloading, make it executable:
chmod +x metasploit.sh
This allows Termux to run the script.
Step 4: Run the Installation Script
Now you can start the installation process.
Run the script with:
./metasploit.sh
During this step, the script will download the necessary files and configure the framework.
Depending on your device and internet speed, the process may take some time. It is best to let the script finish without interrupting it.
Step 5: Start Metasploit
After the installation is complete, you can start the Metasploit console with the following command:
msfconsole
If everything installed correctly, the Metasploit framework will load and display its command interface.
From there, you can explore available modules and begin learning how the framework works.
Learning Metasploit Responsibly
While tools like Metasploit are powerful, they should always be used responsibly. The purpose of learning penetration testing tools is to understand vulnerabilities and improve security.
A good approach for beginners is to create a small practice lab environment where they can safely test and learn. This might include virtual machines or intentionally vulnerable systems designed for cybersecurity training.
By practicing in a controlled environment, learners can gain valuable experience while staying within legal and ethical boundaries.
Final Thoughts
Installing Metasploit in Termux is an interesting way to explore cybersecurity tools using only an Android phone. While it does not replace a full penetration testing lab, it can still be a useful environment for experimentation and learning.
For beginners, the most important part is not having the most powerful device. It is understanding how the tools work and building practical skills over time.
With patience and practice, even a simple setup like Termux can become a valuable learning platform for anyone interested in cybersecurity.
About the Creator
Stephano kambeta
I specialize in breaking down complex cybersecurity trends into actionable privacy steps for everyday users and small businesses. My goal is to help you stay safe in an increasingly connected world.




Comments
There are no comments for this story
Be the first to respond and start the conversation.