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.
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>.isoUse 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
- Log in with the normal account created during installation.
- Confirm that the desktop loads and that the keyboard works correctly.
- Check networking, date and time, time zone, and available storage.
- Update packages from the official repositories.
- Confirm that Nmap is installed and available.
- Use only a local or explicitly authorized target for initial practice.
sudo apt update
sudo apt full-upgradeReview the package changes before confirming. Restart if the update installs a new kernel or requests a reboot.
nmap --versionIf Nmap is not installed, install it through the configured official Kali repositories:
sudo apt install nmap
nmap --versionYou can check the hostname configured during installation with:
hostnamectlFor 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
Installation Decision Summary
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.