Step by Step Guide to Install Metasploit on Ubuntu 20.04 LTS

Metasploit is a free & open-source penetration testing framework. It is used for tool for discovering hidden vulnerabilities present of system. It helps to detect intrusions into their network and identify threats and vulnerabilities. Using metasploit, we can exploit vulnerabilities in various systems, networks, and software.

There are few steps to install Metasploit on ubuntu:

Step 1: Update the System.

apt-get update

Step 2: Install the required packages.

apt install build-essential zlib1g zlib1g-dev libpq-dev libpcap-dev libsqlite3-dev ruby ruby-dev

Step 3: Create a directory.

mkdir ~/apps

  • Change the path.

cd ~/apps

Step 4: Git clone the Metasploit.

git clone

  • Here is the command output.

  • Change the path.

cd metasploit-framework/

  • Install the bundle.

gem install bundler

  • Here is the command output.

bundle install

  • Here is the command output.

Step 5: To use Metasploit on system.


  • Here is the command output.

Step 6: Configure the Metasploit.To setup user name & email address.

git config --global "name_here"
git config --global "[email protected]"

  • Check the Metasploit version.

./msfconsole --version

  • Here is the command output.

  • To updates from within the Metasploit-framework directory.


  • Here is the command output.

  • To set Cron job.

crontab -e

  • Add the following line:

0 1 * * * /home/ubuntu/apps/metasploit-framework/msfupdate > /dev/null 2>&1

Leave a Reply