How to Install Metasploit in Termux 2021

Install MetaSploit in termux

In this guide, We will learn how to install the Metasploit in Termux. Installing Metasploit in Termux is a very straightforward process but, Before getting started, we must know about the Metasploit.

Metasploit is a framework that is used to create, test, and run exploits. Metasploit is commonly used to find vulnerabilities in the system by doing penetration testing. If you want to be an ethical hacker, then you must see the best hacking tools for Termux.

Metasploit is the most important and famous hacking tool for cybersecurity experts. There are thousands of exploits available in its database. These exploits are used to perform hacking/penetration testing on the targeted system. The system can be Android, macOS, Windows server, etc.

Exploits for every system are present in Metasploit. Such capabilities make Metasploit the best penetration testing tool. Almost all cybersecurity experts use this tool to perform penetration testing. 

Metasploit is an application that is used to exploit vulnerabilities in a system. Metasploit Framework can be installed on the Linux, Mac, and Windows operating systems. If you are looking for a Metasploit payload generator, then check this Metasploit payload generator.

By using Termux, you can install the Metasploit framework on your Android mobile. It will be easier for you to carry such a powerful tool in your handset. If you are looking for Termux scripts, then check this out. 

We cannot carry our laptops everywhere to perform penetration testing. But we can take our Android device wherever we want, So let's see how to install the Metasploit in Termux.

How to install Metasploit in Termux 2021

You can install and use the Metasploit hacking app with all features on your android without rooting your Android device using Termux. Here is the procedure on how to install Metasploit in Termux.

Open your Termux and upgrade your repositories by using the following command.

pkg update && pkg upgrade -y

Now install the unstable repository by running this command.

pkg install unstable-repo

Use the below Termux command to Install the Metasploit in your Termux.

pkg install metasploit

The installation process may take some time because Termux will install other packages automatically that are required to run Metasploit, such as Ruby, BisonFTP, etc. Do not close the Termux session until the installation is completed. 

Run the Metasploit 

After the installation process is complete, you can now run and use the Metasploit framework on your Android device via the Termux. Type the below command to run the Metasploit in Termux.


MetaSploit Framework

For the first time, it will take a bit of time to load because the Metasploit is initializing the database for the first time, so wait patiently for the process to finish.

Tip: If you are not running Metasploit for the first time, make sure the PostgreSQL database is running. So that your Metasploit runs more smoothly and quickly.

Make sure Postgresql is working.

The Postgresql database is used by Metasploit as its database. This database is used to speed up the execution process of the commands that you type in Metasploit. Metasploit can run without Postgresql, but the problem is you will get a late response.

Make sure to run Postgresql before running the Metasploit. To check whether Postgresql is running or not, you can use the following command.

pg_ctl -D $PREFIX/var/lib/Postgresql status

You will get the following output if Postgresql is already running.

pg_ctl: server is running (PID: 9023 ) /data/data/com.termux/files/usr/bin/postgres "-D" "/data/data/com.termux/files/usr/var/lib/postgresql"

You will get the following output if Postgresql is not running.

pg_ctl: no server running

Now let's see how to start PostgreSQL.

Use the following command to start the PostgreSQL.

pg_ctl -D $PREFIX/var/lib/postgresql start

Use the following command to stop the PostgreSQL.

pg_ctl -D $PREFIX/var/lib/postgresql stop

If you face any problem in installing Metasploit in Termux. Then here is the video from our YouTube channel on how to install Metasploit Framework in Termux.

Do you want to get more Termux packages? Then check the list of best Termux packages.

Method 2: How to install Metasploit in Termux using Github

This is the second method on how to install Metasploit in Termux using Github. To install Metasploit in Termux using GitHub, please follow the below mention step carefully. And after typing each command, you must wait until the command gets executed.

In the first step, we have to update our Termux repository. Simply use the below command to update the Termux repository.

pkg update && pkg upgrade -y

After updating the Termux repository, our next step is to install some requirements for the Metasploit.

pkg install wget curl openssh git -y

By using the above command, we have installed the following packages: Wget, Curl, Openssh, and git.

Type the below command in your termux to install ncurses-utils

apt install ncurses-utils

Copy the below command and paste it into your Termux to download Metasploit.


Use the below command to make the file read, write, and executable.

chmod +x

Type the below command to run the Metasploit.


If the above command does not work, then try the below command.


Metasploit has been successfully installed in your Termux.

If you want to know more about Termux, then check this article on Termux full tutorial with complete termux commands. Bored with Termux? Try some Termux alternatives.

 Install more great tools for Termux:


In this article, we have learned how to install Metasploit Framework in Termux. Metasploit has great exploits present in its database. New Exploit added in Metasploit as new vulnerability detects in the systems.

You will not face any error if you read the full article carefully. If you encounter any kind of error in installing Metasploit, then you can contact me by commenting below.


  1. bhai metasploit me gem ka error aa rha h koi server ka issue h kya kyuki mane apna mobile tak reset kr diya h but ye problem dobara aa rhi h or pkg intall metasploit krne per work nahi kr rha

    1. Try installing manually using GitHub method.

  2. Sir i also try second method but it was show me ruby version issue.
    What i do now ? Responxe me plz
    As soon as

  3. Could not find Ascii85-1.1.0 in any of the sources

  4. Unable to locate package ruby2

  5. Unable to locate package ruby2

  6. Hola si se me instalo ahora como uso metasploit

  7. Aaah maaaaaaan you are "el puto amo" thank you so much!!!!!! You're the best and from now my herooooooo

  8. bro you are the fucking best one to tell the whole process step by step

  9. Good job bro and Keep helping people like this

  10. Can you tell me how to install nmap bro..

  11. ================= *** Installation... ================= line 74:

    gem: command not found line 77: gem: command not found line 79: gem: command not found line 80: bundle: command not line 81: bundle: command not found

    found line 82: bundle: command not found line 93: termux-elf-cleaner: command not


    ============ *** Database configuration... line 101: initdb: command not found line 103: pg_ctl: command not found line 104: createuser: command not found line 105: createdb: command not found

    What can I do now🤔🤔


Post a Comment

Previous Post Next Post