How to Install Nmap on Mac

Install Nmap on Mac with the official installer or Homebrew, then fix blocked installers, Rosetta requirements, and command-not-found errors.

T

Technobezz

Senior Editor

Sep 15, 2026
4 min read

Contents

Don't Miss the Good Stuff

Get tech news that matters delivered weekly. Join 50,000+ readers.

A blocked installer or a command-not-found error stops your Nmap setup before you get to use it. Start with the official Mac installer, or use Homebrew if you prefer Terminal. Here’s how to complete either installation and handle security blocks, Rosetta requirements, and missing commands.

Start with the official Nmap installer

Open the Nmap download page at Mac OS X Binaries.

Select Latest stable release installer to download nmap-7.991.dmg.

Double-click the downloaded DMG.

Open nmap-7.991.mpkg inside the mounted image.

Follow the installer’s prompts, including authentication when requested. The installer offers Nmap, Zenmap, Ncat, and Ndiff as components.

After installation finishes, eject the mounted image using Eject.

Open Applications > Utilities > Terminal.

Run nmap --version. Version information confirms that your shell can find Nmap.

If installation fails, try the security exception below for a blocked installer or the Rosetta steps for an Apple silicon Mac. Homebrew provides another installation route.

Allow an installer blocked by macOS

First, attempt to open the downloaded installer. Only make a security exception for a download from the official Nmap website that you trust.

Open System Settings > Privacy & Security.

Scroll down to Open Anyway and click it.

When the warning returns, click Open. Apple removed the older Control-click or right-click override for incorrectly signed or unnotarized software beginning with macOS Sequoia 15. On current versions, use Privacy & Security.

Install through Homebrew instead

If Homebrew is already installed and its shell setup is complete, run brew install nmap in Terminal.

For a new Homebrew setup, start by running xcode-select --install in Terminal to install Apple’s Command Line Tools.

Click Install in the system dialog.

Accept the Command Line Tools License Agreement.

Click Done when the tools finish installing.

Run Homebrew’s official installation command: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)".

Follow the installation prompts.

Complete the shell-configuration instructions printed by the installer before using brew.

Run brew install nmap.

Check the installation with nmap --version.

Tip: Homebrew’s Nmap formula includes nmap, ncat, ndiff, and nping but does not list Zenmap, and Homebrew’s detailed support documentation identifies Apple silicon on macOS 15–27 as supported and Intel as Tier 3.

Add Rosetta for the Intel download

The official Nmap Mac download is x86-64 software, so an Apple silicon Mac needs Intel translation to run it.

Connect your Mac to the internet. Apple supports Rosetta on Apple silicon through macOS 27.

Open Applications > Utilities > Terminal.

Run softwareupdate --install-rosetta.

Follow the prompts to complete installation.

For the alternative app-prompt route, open an Intel-based app.

If the Rosetta prompt appears, click Install.

Enter your macOS user name and password when requested.

Rosetta supplies Intel translation, without guaranteeing compatibility with every Nmap component. Nmap states that its official Mac binary was tested on macOS 10.9 and later; it does not publish an Apple silicon compatibility breakdown.

Restore missing Homebrew commands

This fixes command-not-found errors caused by skipped Homebrew shell setup.

Return to the shell-configuration instructions printed by the Homebrew installer. Nmap must be installed and its installation directory included in PATH, the directories your shell searches for commands.

On Apple silicon, run eval "$(/opt/homebrew/bin/brew shellenv)".

On Intel, run eval "$(/usr/local/bin/brew shellenv)" instead.

Add the matching line to the shell configuration file identified by the installer so the setup persists.

If Nmap is not installed yet, run brew install nmap.

Check the result with nmap --version.

Frequently Asked Questions

How do I add Zenmap through MacPorts?

With MacPorts and Nmap installed, run sudo port install zenmap in Terminal. To update Zenmap later, run sudo port selfupdate, followed by sudo port upgrade zenmap.

How do I update or reinstall Nmap with Homebrew?

Run brew update, then brew upgrade nmap to update it. To reinstall the Homebrew package, run brew reinstall nmap.

How do I uninstall Nmap?

For a Homebrew installation, run brew uninstall nmap. For MacPorts, run sudo port uninstall nmap. Deleting the downloaded DMG or Zenmap.app alone does not remove the installed command-line suite.

What if my work Mac will not let me install Nmap?

Ask your administrator to review the installation restrictions. Managed Macs support policies that block users from overriding Gatekeeper. The relevant Security payload settings are “Configure Gatekeeper settings” and “Don’t allow user to override Gatekeeper setting.”

Share