Environment setup inside Mac for Kali Linux Penetration Testing
You'll be able to start penTesting after settingup Kali Linux inside your mac.
1: Download Docker and Install by following guideline mentioned in this link:
https://docs.docker.com/desktop/setup/install/mac-install/
2: Pull the Kali Linux Docker Image
docker pull kalilinux/kali-rolling
3. Launch the Container
For Apple Silicon (M1/M2/M3/M4 Macs): Force the native ARM64 platform structure for optimal execution:
docker run --platform linux/arm64/v8 -it --name my-kali kalilinux/kali-rolling /bin/bash
For Intel Macs:
docker run -it --name my-kali kalilinux/kali-rolling /bin/bash
Tip: To prevent potential internet speed issues inside the container, pass a public DNS server like Google DNS (8.8.8.8).
docker run -it --name my-kali --dns 8.8.8.8 kalilinux/kali-rolling /bin/bash
Once inside, your terminal prompt will change to root@container_id:/#, verifying you are successfully running inside the Kali Linux environment.
4. Install Penetration Testing Tools
apt update && apt upgrade -y
Install standard Metapackages: For core headless penetration tools (~300-400MB):
apt install -y kali-linux-headless
For the default collection of popular CLI tools:
apt install -y kali-linux-default
For isolated specific utilities (e.g., Nmap):
apt install -y nmap curl git
Step 4: Save Your Progress (Commit the Container)
If you exit the container right now, your installed tools will remain in the stopped container but won't be part of the base image. To save your fully equipped environment as a reusable custom image
Keep your Kali container running and open a new terminal tab on your Mac.
Find your container ID or name:
docker ps
Commit the changes to a new image name (e.g., my-kali-tools):
docker commit my-kali my-kali-tools
You can now start up your fully configured penetration testing environment anytime using:
docker run -it my-kali-tools /bin/bash
Managing the Container Later
- To stop the container: Type exit inside the shell.
- To resume a stopped container: Use
docker start -ai my-kali