How to Install Nmap on Ubuntu

By
Vladimir Kaplarevic
Published:
February 10, 2025
Topics:

Introduction

Nmap (Network mapper) is a powerful network discovery and network security auditing tool. It is free, open-source, and easy to install. Nmap scans for vulnerabilities on a network, performs inventory checks, and monitors host or service uptime, alongside many other useful features.

System and network administrators use Nmap to scan networks, identify connected devices, check open ports, and gather data about running services. The tool supports various scanning techniques, including UDP, TCP, and stealth scanning. Nmap is an essential tool for cybersecurity and IT professionals.

This tutorial shows how to install Nmap on Ubuntu in three simple steps.

How to Install Nmap on Ubuntu

Prerequisites

Note: The steps in this guide are tested and working on Ubuntu 18.04, 20.04, 22.04, and 24.04.

Step 1: Update Ubuntu Package List

Before installing software on Ubuntu, update the system's package list to ensure the latest version and avoid dependency issues.

Run the following command to update the package list:

sudo apt update
sudo apt update terminal output ubuntu

The system updates the package lists and confirms that the action is complete. Once the update is completed, proceed to the next step.

Step 2: Install Nmap

To install Nmap on Ubuntu, run the command:

sudo apt install nmap
sudo apt install nmap continue y terminal output

The system prompts you to confirm and continue the installation. Press y and then Enter to continue. After confirming, the package manager downloads and installs Nmap and any dependencies.

Note: For different installation methods, see our in-depth guide on installing and useing Nmap on Linux.

Step 3: Verify Nmap Version Installed

Verify the installation was successful by checking the Nmap version:

nmap --version
nmap --version terminal output

The output shows detailed information about Nmap and build details.

Additional Nmap Usage Examples

Nmap has a variety of scanning options to address different use cases. Common examples include:

nmap 192.168.1.1
nmap 192.168.1.1 terminal output
nmap -sP 192.168.1.0/24
nmap -sP 192.168.1.0 subnet slash 24 terminal output
nmap -p 1-65535 192.168.1.1
nmap -p 1-65535 192.168.1.1 terminal output
  • Identify running services and their versions:
nmap -sV 192.168.1.1
nmap -sV 192.168.1.1 terminal output

Note: Nmap has many options available for scanning scan remote systems. Explore the most common Nmap commands.

Conclusion

This guide showed how to install and use Nmap on Ubuntu. This versatile and powerful network scanning tool is easy to install.

Next, see our comprehensive list of Linux network commands, which includes a free cheat sheet.

Was this article helpful?
YesNo