How to Install Metasploit Framework in Termux Android

Install MetaSploit in termux

In this guide, we will learn how to install the Metasploit framework in Termux Android. Installing Metasploit in Termux is a very easy process but, Before getting started we must know about the importance of Metasploit commands and what Metasploit is.

Metasploit is an application that is used to create, test, and run exploits. Metasploit is commonly used to find vulnerabilities in the system by doing penetration testing on the system. Some hacker uses this framework for illegal hacking.

Metasploit is famous for having 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.

Exploit for every system are present in Metasploit. Such capabilities make Metasploit the best hacking tool. Each and every hacker use this tool to perform hacking/penetration testing.

Metasploit is a tool/application that is created and used to exploit security holes (vulnerabilities) in a system.

The Metasploit Framework can be installed on the Linux, Mac, and Windows operating systems. Using Termux you can install the Metasploit framework on your Android mobile so it will be easier and more flexible for you to carry such a powerful tool in your handset.

We cannot carry our laptops everywhere to perform penetration testing. But we can carry our Android device approx everywhere. So now let's see how to install the Metasploit framework in Termux Android.

Install Metasploit in Termux Android without Root

You can install and use Metasploit with all features on your android without rooting your Android device using Termux. If you have not installed Termux then you can follow our guide on how to install Termux. Or you can simply install Termux by going to Google Playstore.

  • Open your Termux and install the unstable repository by running the following command pkg install unstable-repo
  • Install Metasploit by running the command 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.

Do not upgrade manually by editing content that is located at $ PREFIX /opt/metasploit, because this will damage the arrangement of the Metasploit system which will result in Error.

Run the Metasploit Framework

After the installation process is complete you can now run and use the Metasploit framework on your Android device via the Termux terminal emulator. To run the Metasploit type command msfconsole In the Termux then press enter and wait for Metasploit to load.

MetaSploit Framework

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

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

Make sure Postgresql is already running

The Postgresql database is usually used by Metasploit console as its database, this database is used to speed up the execution process of the command that you type in msfconsole. Don't worry Metasploit still can run without Postgresql but the problem is you will get a response of your commands very slow.

Make sure you have run the Postgresql before running the Metasploit console (msfconsole). 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"

But if you get a response like this: "pg_ctl: no server running". This means Postgresql is not running.

Now let's see how to start Postgresql 

To start the Postgresql you can run the following command pg_ctl -D $PREFIX/var/lib/postgresql start.

To stop the Postgresql you can run the following command 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.


In this article, we have learned how to install Metasploit Framework in Termux Android. Metasploit has a very powerful exploits present in its database. New Exploit added in Metasploit as new vulnerability detects in the systems. So be sure to update Metasploit if you have an older version of Metasploit you can update Metasploit using the command apt update; apt install metasploit

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

Post a Comment

Previous Post Next Post