AlmaLinuxRHEL Based

How To Install Metasploit on AlmaLinux 9

Install Metasploit on AlmaLinux 9

In this tutorial, we will show you how to install Metasploit on AlmaLinux 9. Metasploit, a powerful penetration testing tool, has long been a go-to choice for security professionals and ethical hackers seeking to identify and address vulnerabilities in systems.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of Metasploit on AlmaLinux 9. You can follow the same instructions for CentOS and Rocky Linux or RHEL-based.


  • A server running one of the following operating systems: AlmaLinux 9.
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • SSH access to the server (or just open Terminal if you’re on a desktop).
  • An active internet connection. You’ll need an internet connection to download the necessary packages and dependencies for Metasploit.
  • A non-root sudo user or access to the root user. We recommend acting as a non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.

Install Metasploit on AlmaLinux 9

Step 1. Before any installation, it’s imperative to ensure your system is up to date. Execute the following commands in your terminal:

sudo dnf clean all
sudo dnf update

Step 2. Installing Necessary Dependencies.

Metasploit requires a set of prerequisites to function seamlessly. Install these packages:

sudo dnf install curl gpg gcc-c++ make automake autoconf git subversion

Step 2. Installing Metasploit on AlmaLinux 9.

To install Metasploit, you need to add its repository. Execute these commands:

curl > msfinstall && \
chmod 755 msfinstall && \

Once the repository is added, install Metasploit with this command:

sudo dnf install metasploit

After installation, initialize the Metasploit database:

sudo msfdb init

To verify your installation, start the Metasploit console:


If it launches without errors, you’re good to go.

Step 4. Configure Metasploit.

A. Setting up the Metasploit Database:

Ensure your database is always updated by running:


B. Configuring Metasploit Startup Options:

Edit the startup configuration file to meet your requirements:

nano /etc/metasploit-framework/database.yml

C. Checking the Metasploit Version:

Keep your Metasploit updated. Use the following command to check for the latest version:

msfconsole -q -x 'version'

Step 5. Basic Usage.

A. Starting the Metasploit Console:

You can start the Metasploit console anytime by typing:


B. Understanding the MSFconsole Interface:

The MSFconsole is where the magic happens. Familiarize yourself with its commands and options. Type help for a list of commands.

C. Updating Metasploit:

Regularly update Metasploit to stay on top of security:


D. Using the Help Command for Assistance:

Metasploit comes with extensive documentation. For quick assistance, use the help command followed by the topic:

help search

Congratulations! You have successfully installed Metasploit. Thanks for using this tutorial for installing Metasploit on your AlmaLinux 9 system. For additional help or useful information, we recommend you check the official Metasploit website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!


r00t is a seasoned Linux system administrator with a wealth of experience in the field. Known for his contributions to, r00t has authored numerous tutorials and guides, helping users navigate the complexities of Linux systems. His expertise spans across various Linux distributions, including Ubuntu, CentOS, and Debian. r00t's work is characterized by his ability to simplify complex concepts, making Linux more accessible to users of all skill levels. His dedication to the Linux community and his commitment to sharing knowledge makes him a respected figure in the field.
Back to top button