Nmap online course

How to Install Kali Linux for Nmap

Learn how to install Kali Linux on dedicated hardware or in a virtual machine, configure the system safely, and verify Nmap after installation.

Overview

Kali Linux is a Debian-based Linux distribution designed for security testing, digital forensics, and security training. It includes or supports many security tools, including Nmap, a network discovery and security-auditing tool.

Kali Linux is not required to use Nmap. Nmap also runs on other Linux distributions, Windows, and macOS. This guide focuses on installing Kali for a controlled learning lab.

Choose an Installation Method

Decide where Kali will run before downloading an installer. A virtual machine is an emulated computer running inside another operating system. It is the best choice for most beginners because it reduces risk to the host system, is easy to back up, and can be reset with snapshots.

Method: Virtual machine. Best for: Beginners, coursework, and isolated labs. Advantages: Easy to reset, does not normally alter the host disk, and supports snapshots. Limitations: Uses host CPU, memory, and storage; some wireless or hardware features may be unavailable. Risk level: Low when networking is configured carefully.

Method: Dedicated hardware. Best for: A spare computer used only for security training. Advantages: Direct hardware access and full performance. Limitations: Installation can erase the disk. Risk level: Medium if the wrong disk is selected.

Method: Live boot media. Best for: Temporary use, hardware testing, or recovery work. Advantages: Does not normally install to the internal disk. Limitations: Changes may not persist, and performance depends on the USB drive. Risk level: Low for disk contents, but care is still required when mounting or modifying disks.

Method: Dual boot. Best for: Experienced users who need Kali and another operating system on one computer. Advantages: Near-native performance and direct hardware access. Limitations: Requires careful partitioning and boot-loader configuration. Risk level: High compared with a VM because partition or boot mistakes can affect existing systems.

Method: Bootable USB installer. Best for: Installing to dedicated hardware. Advantages: Faster and more convenient than DVD media, and many current computers lack optical drives. Limitations: The USB contents are erased when the image is written.

Plan Hardware and Storage

Review Kali's current hardware guidance on its official download and documentation pages before installation. Plan enough memory, CPU capacity, and disk space for the operating system, desktop environment, updates, and lab targets. A VM also needs resources left over for the host operating system.

Back up important files before changing partitions, firmware settings, or boot configuration. Do not use a disk containing valuable data until you have confirmed that the backup can be restored.

Obtain the Installer Safely

Download Kali only from the official Kali Linux download source. Select an image that matches your computer architecture and installation method.

  • An installer ISO image is a disk-image file used to create installation media or attach to a VM.
  • A live image starts Kali without a conventional installation and may support a persistent storage configuration.
  • A prebuilt virtual-machine image is already prepared for a supported hypervisor and can reduce installation work.

Do not confuse downloading an ISO with installing it. An ISO must be written as an image to a USB drive or attached to the VM's virtual optical drive.

Verify the Download

A checksum is a cryptographic digest used to detect a corrupted or altered file. Compare the SHA-256 digest of the downloaded file with the value published by the official Kali download page. Where Kali provides signature verification, verify the signed checksum information as well.

sha256sum <kali-installer-image>.iso

Use the actual downloaded filename in place of the placeholder. Do not continue with an image whose checksum does not match. Download it again from the official source and check the replacement.

Create and Boot Installation Media

Write a Bootable USB

Use a reputable image-writing tool appropriate for your current operating system. Select the Kali ISO, select the correct USB drive, and write the image. Confirm the target carefully because writing an image normally erases the USB contents.

Copying the ISO file into a USB folder is not the same as writing an image. A bootable USB contains the structures needed by firmware to start the installer.

Choose the USB at Boot

Insert the USB before powering on or restarting the computer. Open the one-time boot menu or firmware setup and select the USB device. The key varies by manufacturer; common choices include a function key, Delete, or Escape.

UEFI is modern firmware that initializes hardware and starts an operating system. BIOS is the older firmware terminology and boot environment found on many older systems. Prefer the UEFI entry when the computer and installation media support it. Keep the installation mode consistent with the mode used by other systems if configuring dual boot.

Secure Boot is a UEFI feature that restricts which boot software may run. If the installer will not start, check whether the selected Kali image supports the device's Secure Boot configuration. Follow the official Kali guidance for supported options; disabling Secure Boot changes the device's security posture and should be a deliberate decision.

Start the Kali Installer

After booting from the installation medium, choose Graphical install for a visual setup process or the text-based installation option if you prefer keyboard-driven menus. The installer guides you through language, region, keyboard, network, storage, accounts, package sources, and boot settings.

Configure Regional Settings

Select the installation language, location, locale, time zone, and keyboard layout. These choices affect the installer's language, date and time formatting, time-zone handling, and keyboard input. Test characters such as punctuation and symbols if you use a non-US keyboard.

Configure Network Identity and Connectivity

Hostname and Domain Name

A hostname is the local name used to identify a computer on a network. Choose a simple name such as kali-lab that helps you distinguish the machine from other lab systems.

A domain name identifies an organizational DNS namespace. It is normally optional for a personal computer, home network, or isolated lab, so leave it blank unless a school, employer, or lab design provides a specific value.

Network and Proxy Settings

Connect to a network when available so the installer can retrieve packages from official repositories. Wired networking is often the simplest option. If wireless hardware is not recognized, complete the base installation if possible and troubleshoot the hardware afterward.

A proxy is an intermediary network service. Enter an HTTP or HTTPS proxy only when the local network requires one, using details supplied by the network administrator. Do not guess proxy values or replace official repositories with untrusted package sources.

Create the User Account

Modern Kali uses a normal-user and sudo-oriented workflow rather than assuming a default root login. Sudo is a mechanism that allows an authorized normal user to run administrative commands after authentication.

Create a normal user account and use a long, unique password. Do not use weak, reused, or default credentials. Store the password in an approved password manager rather than in plain text. If you enable disk encryption, protect its startup credential separately: losing the encryption credential can make the stored data unrecoverable.

Partition the Disk Carefully

A partition is a logical division of a physical storage device used by an operating system.

Guided Partitioning

Guided partitioning is appropriate for a dedicated VM with an empty virtual disk or a spare computer whose disk has already been backed up. Select the correct target disk, choose the guided layout, and inspect the summary before accepting formatting and other changes.

Manual Partitioning

Manual partitioning is an advanced option for dual boot, custom layouts, or existing Linux installations. Confirm the device names, existing partitions, mount points, filesystem choices, and formatting flags. Never assume the first disk listed is the correct disk.

A single-partition layout keeps most of the Linux filesystem together and is simple for a dedicated lab. A separate home-directory layout stores user files on another partition, which can make reinstalls or data management easier but requires more planning.

Full-Disk Encryption

Full-disk encryption encrypts stored data and requires credentials during startup. It protects data if the physical device is lost or stolen, but it does not protect a system that is already unlocked. Keep recovery information secure and understand that losing the encryption credential may prevent access to the files.

Before confirming, review the final partition summary. Verify the disk model or virtual-disk identity, planned formatting, encryption choice, and mount layout.

Package Repositories and Software Selection

A package repository is a software source from which the operating system obtains and updates packages. Enable the official Kali repositories when internet access is available and appropriate. If the network is restricted, finish the base installation and update later from an approved network rather than adding untrusted sources.

Package selection determines the initial desktop environment and tool set. Choose only the components needed for your coursework when storage or bandwidth is limited. Additional tools can be installed after first boot.

Install GRUB and Finish

GRUB is a common Linux boot loader. It starts Linux and can offer a choice between operating systems. Install it to the appropriate system disk or EFI System Partition as directed by the installer.

Boot-loader configuration is especially important for UEFI systems and dual-boot computers. Select the intended disk or EFI location, review the warning, and allow the installer to complete. When installation finishes, reboot and remove the USB or detach the ISO so the computer starts from the installed system.

First Boot Checklist

  1. Log in with the normal account created during installation.
  2. Confirm that the desktop loads and that the keyboard works correctly.
  3. Check networking, date and time, time zone, and available storage.
  4. Update packages from the official repositories.
  5. Confirm that Nmap is installed and available.
  6. Use only a local or explicitly authorized target for initial practice.
sudo apt update
sudo apt full-upgrade

Review the package changes before confirming. Restart if the update installs a new kernel or requests a reboot.

nmap --version

If Nmap is not installed, install it through the configured official Kali repositories:

sudo apt install nmap
nmap --version

You can check the hostname configured during installation with:

hostnamectl

For a guided introduction to Nmap, see Nmap and installing Nmap on Linux. Initial practice should be limited to the local machine or an intentionally configured training target.

Virtual Machine Installation

Create a Kali VM using a supported hypervisor, or import an official prebuilt Kali VM image. If installing from an ISO, create a new VM, attach the ISO as virtual optical media, create a virtual disk, and start the VM.

Allocate reasonable CPU, memory, and disk resources based on the host system. Leave enough resources for the host to remain responsive. Increase resources only when the lab requires them.

Virtual Networking Modes

  • NAT: The VM shares the host's connection and is usually suitable for package updates and basic internet access.
  • Host-only: The VM communicates with the host and other host-only machines without direct exposure to the normal network.
  • Isolated lab network: A separate virtual network for Kali and intentionally vulnerable practice targets. This is preferable for exercises that should not reach household or organizational systems.

A common beginner lab uses NAT for updates and a separate host-only or isolated interface for authorized targets. Avoid bridging a vulnerable target directly onto a home or workplace network.

Take a VM snapshot before major configuration changes or exercises. A snapshot is a saved VM state that lets you return to an earlier point, although it is not a replacement for independent backups.

Common Boot and Installation Problems

Symptom: The computer starts the existing operating system. Likely cause: Boot order is wrong, the USB was not written as bootable, or it was connected too late. Check or resolution: Open the one-time boot menu, select the USB or optical drive, recreate the media with an image-writing tool, or try another USB port.

Symptom: The image fails an integrity check or will not boot. Likely cause: Corrupted download, incorrect writing process, or damaged media. Check or resolution: Compare the published checksum, download again from the official source, rewrite the media, or use another drive.

Symptom: No disk appears in partitioning. Likely cause: Storage-controller configuration, an unattached VM disk, or an incompatible firmware setting. Check or resolution: Confirm detection in firmware or hypervisor settings and review the controller configuration without changing storage modes blindly.

Symptom: The installed system does not boot. Likely cause: Installation media is still selected, GRUB targets the wrong location, or UEFI and legacy modes do not match. Check or resolution: Remove the media, inspect firmware boot entries and mode, and use installer recovery or a live environment if boot-loader repair is needed.

Symptom: Network access or updates fail. Likely cause: Missing connectivity, incorrect proxy, wrong system time, DNS trouble, or repository configuration. Check or resolution: Try wired networking, verify proxy details, correct date and time, test DNS, and use official Kali repositories only.

Symptom: The shell reports that Nmap is not found. Likely cause: Nmap was not selected, package metadata is stale, or the command is unavailable in the environment. Check or resolution: Run sudo apt update, install with sudo apt install nmap, and confirm with nmap --version.

Installation Decision Summary

Installer step: Installation method. What it controls: Where Kali runs. Beginner choice: Virtual machine. Alternative: Dedicated hardware for a spare computer; dual boot only with careful planning.

Installer step: Language, location, and keyboard. What it controls: Installer language, locale, time zone, and input. Beginner choice: Select the values matching your location and keyboard. Alternative: Use a different locale for a specific course or lab requirement.

Installer step: Hostname and domain. What it controls: Network identity. Beginner choice: A simple hostname and no domain in a personal lab. Alternative: Use organization-provided values.

Installer step: Disk layout. What it controls: Partitions, formatting, and encryption. Beginner choice: Guided partitioning on a new VM disk or backed-up empty machine. Alternative: Manual partitioning for dual boot or custom Linux layouts.

Installer step: Repository and software selection. What it controls: Package sources, desktop, and initial tools. Beginner choice: Official repositories and a practical, limited tool set. Alternative: Add packages after installation.

Installer step: Boot loader. What it controls: How the system starts. Beginner choice: Install GRUB to the selected system disk or EFI location. Alternative: Custom dual-boot configuration for experienced users.

Next Steps

Once Kali is updated and Nmap responds to nmap --version, continue with authorized host discovery, understanding port states, and interpreting scan results. Keep the practice network controlled and document the systems you are permitted to test.