How to Install SQLmap in Linux

Last Updated : 22 Jul, 2026

SQLmap is an open-source penetration testing tool designed to automate the detection and exploitation of SQL Injection (SQLi) vulnerabilities. It identifies vulnerable parameters, fingerprints database management systems (DBMS), retrieves database information and supports advanced testing features.

Note: SQLmap should only be used on systems you own or have explicit authorization to test.

Requirements Before Installation of SQLmap

Before installing SQLmap, ensure your Linux system meets the following requirements:

  • Using Controlled Environment(Virtualbox, Vmware etc)
  • Linux distribution (Ubuntu, Debian, Kali, Fedora, Arch, CentOS, etc.).
  • Python 3.8 or later.
  • Git (recommended).
  • Internet connection.
  • Terminal access.
  • sudo privileges (for package installation).

Check Whether Python is Installed

Most Linux distributions include Python by default.Verify the installed version. Run the below Command:

python3 --version

Output:

g
Python3 --version

If Python is not installed

Run the command to install python on different distro of LINUX.

Ubuntu/Debian

Run the Command:

sudo apt update
sudo apt install python3

Fedora

Run the Command:

sudo dnf install python3

Arch Linux

Run the Command:

sudo pacman -S python

Installing from the official Git repository provides the latest version and makes updates easier.

Step 1: Install Git

Refer to this article to: Install and setup the git on Linux

Step 2: Clone the SQLmap Repository

Visit the SQLmap repository on browser and search for sqlmap git install. Click on first site to go to repository. Copy the HTTPS path in code section and Run the below command on LINUX machine.

git clone --depth 1 https://github.com/sqlmapproject/sqlmap.git

Output:

Step 3: Navigate to the Directory

Run the Command:

cd sqlmap

Output:

e
Navigate Directory

Method 2: Install SQLmap Using Package Manager

Some Linux distributions include SQLmap in their official repositories.

Ubuntu/Debian

Run the Command:

sudo apt update
sudo apt install sqlmap

Output:

q
Update and Install SQLmap

Fedora

Run the Command on Fedora distro:

sudo dnf install sqlmap

Arch Linux

Run the command on Arch Linux:

sudo pacman -S sqlmap

Kali Linux

SQLmap is generally pre-installed. Verify by Run the below command:

sqlmap --version

If missing:

Run the Command

sudo apt install sqlmap

Method 3: Install SQLmap Using pip

Although Git installation is recommended, SQLmap can also be installed using pip if available.

Ubuntu/Debian

Run the Command:

sudo apt install python3-pip

Output:

q
Python PIP Install

Install SQLmap

Run the Command:

pip3 install sqlmap

Verify SQLmap Installation

Check whether SQLmap is accessible

Run the Command:

sqlmap --version
or
python3 sqlmap.py --version

Output:

q
SQLmap version

Display the help menu

Run the Command:

sqlmap -h
or
python3 sqlmap.py -h
q
SQLmap help

Update SQLmap

If installed using Git

Run the Command:

cd sqlmap
git pull

Output:

S
Update SQLmap

If installed using apt

Run the Command:

sudo apt update
sudo apt upgrade sqlmap

Output:

Uninstall SQLmap

Git Installation

Simply remove the cloned directory. Run the below Command:

rm -rf sqlmap

Ubuntu/Debian

Run the Command:

sudo apt remove sqlmap

Fedora

Run the Command:

sudo dnf remove sqlmap

Arch Linux

Run the command:

sudo pacman -R sqlmap

Best Practices After Installation

  • Keep SQLmap updated to receive the latest bug fixes and features.
  • Use Python 3 for compatibility with current releases.
  • Prefer the official Git repository if you need the newest version.
  • Run SQLmap only on systems where you have explicit permission to perform security testing.
  • Review the built-in help (sqlmap -h) to understand available options before running assessments.
Comment