How to Install NMAP on Ubuntu

In this tutorial, we will show you how you to install the latest Nmap tool on your Ubuntu system using various methods.

How to Install NMAP on Ubuntu


Nmap, short for Network Mapper, is an open-source network discovery, scanning, and security auditing tool. System administrators and network engineers widely use it to evaluate network security, manage inventory, and monitor service uptime.

Nmap accomplishes its tasks by sending specially crafted packets to target hosts and analyzing the responses. This allows Nmap to gather information about the target network and its devices, such as open ports, operating systems, and services.


  1. Ubuntu System
  2. Terminal Access
  3. Sudo permissions
  4. A working network connection

We have tested this tutorial on Ubuntu 20.04 and Ubuntu 22.04.

Step 1 - Refresh Ubuntu Package List

Start by updating the Ubuntu package list with the command:

sudo apt-get update


Hit:1 jammy InRelease
Get:2 jammy-security InRelease [110 kB]
Get:3 jammy-updates InRelease [119 kB]
Get:4 jammy-backports InRelease [108 kB]
Get:5 jammy-security/main amd64 Packages [728 
Fetched 26.6 MB in 23s (1152 kB/s)
Reading package lists... Done

Once the package lists are up to date, install Nmap on Ubuntu.

Step 2 - Install Nmap

To install Nmap, run the command:

sudo apt-get install nmap -y

Step 3 - Verify Nmap is Installed

You can verify Nmap is installed and running on your machine by checking the version as shown in the command below:

nmap --version


Nmap version 7.80 ( )
Platform: x86_64-pc-linux-gnu
Compiled with: liblua-5.3.6 openssl-3.0.2 nmap-libssh2-1.8.2 libz-1.2.11 libpcre-8.39 libpcap-1.10.1 nmap-libdnet-1.12 ipv6
Compiled without:
Available nsock engines: epoll poll select

Installing Nmap Using DPKG

If you do not wish to use apt to install the Nmap package, you can download the deb package from the link below:

Debian -- Details of package nmap in bullseye

For example, run the command:


Once downloaded, install the package with dpkg as shown:

sudo dpkg -i nmap_7.91+dfsg1+really7.80+dfsg1-2_amd64.deb

The command above should use dpkg to install and configure Nmap on your machine.


Having learned how to install and utilize Nmap on Ubuntu, you are now equipped with the knowledge to efficiently employ this versatile and potent scanning tool. Its installation process is straightforward, rendering it an easily accessible option.

Other Cool Stuff.

We are certain you will love these tutorials. Check them out.

How to Use Nmap to Perform DNS Enumeration: Using Various Scripts
NMAP is one of the popular tools when it comes to network scanning. So, in this post, we’ll explore how we can perform a DNS Enumeration using NMAP.
How to Ping a Specific Port in Windows and Linux
In this post, we will discuss how you can use various tools to send a ping request to check if a target port on a specific host is alive.

If you enjoy our content, please consider buying us a coffee to support our work:

Table of Contents
Great! Next, complete checkout for full access to GeekBits.
Welcome back! You've successfully signed in.
You've successfully subscribed to GeekBits.
Success! Your account is fully activated, you now have access to all content.
Success! Your billing info has been updated.
Your billing was not updated.