Installing Kali Linux on Raspberry Pi and Pi Zero

Transform your Raspberry Pi into a portable penetration testing powerhouse with Kali Linux. This guide covers installation on Raspberry Pi 4, Pi 3, and the compact Pi Zero.

Why Kali Linux on Raspberry Pi?

Running Kali Linux on a Raspberry Pi gives you:

  • Portability - Pocket-sized pentesting lab
  • Low power consumption - Perfect for extended operations
  • Stealth - Small form factor for discrete testing
  • Cost-effective - Budget-friendly security testing platform

Requirements

For Raspberry Pi 4/3

  • Raspberry Pi 4 (2GB+ RAM recommended) or Pi 3
  • MicroSD card (16GB minimum, 32GB+ recommended)
  • USB-C power supply (Pi 4) or Micro USB (Pi 3)
  • HDMI cable and monitor
  • USB keyboard and mouse
  • Ethernet cable or WiFi

For Raspberry Pi Zero/Zero W

  • Raspberry Pi Zero or Zero W
  • MicroSD card (16GB minimum)
  • Micro USB power supply
  • Mini HDMI adapter
  • USB OTG adapter for keyboard/mouse
  • WiFi dongle (if using Pi Zero without W)

Step 1: Download Kali Linux ARM Image

Visit the official Kali Linux downloads page and get the correct ARM image:

For Raspberry Pi 4/3:

https://www.kali.org/get-kali/#kali-arm

Download: Kali Linux RaspberryPi 2, 3, 4 and 400 (img.xz)

For Raspberry Pi Zero/Zero W: Download: Kali Linux RaspberryPi Zero W (img.xz)

Step 2: Flash the Image to MicroSD Card

  1. Download and install Balena Etcher
  2. Insert your MicroSD card
  3. Open Etcher and select the downloaded Kali image
  4. Select your MicroSD card as the target
  5. Click “Flash!” and wait for completion

Using dd (Linux/macOS)

# Extract the image
xz -d kali-linux-*-raspberry*.img.xz

# Find your SD card
lsblk  # or 'diskutil list' on macOS

# Flash the image (replace /dev/sdX with your SD card)
sudo dd if=kali-linux-*-raspberry*.img of=/dev/sdX bs=4M status=progress
sync

WARNING: Double-check the device name! Wrong selection will destroy data.

Step 3: First Boot Configuration

  1. Insert the MicroSD card into your Raspberry Pi
  2. Connect monitor, keyboard, and mouse
  3. Connect power supply to boot

Default credentials:

  • Username: kali
  • Password: kali

IMPORTANT: Change the default password immediately!

passwd

Step 4: Initial Setup

Update the System

sudo apt update
sudo apt full-upgrade -y

Configure WiFi (if not using Ethernet)

# Edit wpa_supplicant configuration
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

Add your WiFi credentials:

network={
    ssid="YourNetworkName"
    psk="YourPassword"
}

Restart networking:

sudo systemctl restart networking

Enable SSH (for headless operation)

sudo systemctl enable ssh
sudo systemctl start ssh

Find your Pi’s IP address:

ip addr show

Now you can SSH from another machine:

ssh kali@<raspberry-pi-ip>

Step 5: Optimize for Raspberry Pi

Expand Filesystem

sudo raspi-config

Navigate to: Advanced Options > Expand Filesystem

Install Additional Tools

# Install popular pentesting tools
sudo apt install -y \
  nmap \
  aircrack-ng \
  wireshark \
  burpsuite \
  sqlmap \
  metasploit-framework \
  john \
  hydra \
  nikto

Configure Swap (Raspberry Pi Zero)

Pi Zero has limited RAM, so configure swap:

sudo dphys-swapfile swapoff
sudo nano /etc/dphys-swapfile

Change CONF_SWAPSIZE=100 to CONF_SWAPSIZE=512

sudo dphys-swapfile setup
sudo dphys-swapfile swapon

Raspberry Pi Zero Specific Setup

Enable USB Gadget Mode

For using Pi Zero as a USB device:

echo "dtoverlay=dwc2" | sudo tee -a /boot/config.txt
echo "modules-load=dwc2,g_ether" | sudo tee -a /boot/cmdline.txt

Monitor Performance

Pi Zero is less powerful, so monitor resource usage:

# Install htop
sudo apt install htop

# Check temperature
vcgencmd measure_temp

For Portable Operations

  • External WiFi adapter - Better range and packet injection support
    • Alfa AWUS036NHA
    • TP-Link TL-WN722N v1
  • Portable battery pack - 10,000mAh or higher
  • Small touchscreen - 3.5” or 5” HDMI display
  • Case with cooling - Prevent overheating during intensive tasks

Performance Tips

Raspberry Pi 4

  • Excellent for most pentesting tasks
  • Can run multiple tools simultaneously
  • Good for wireless attacks and web app testing

Raspberry Pi 3

  • Suitable for light to moderate pentesting
  • May struggle with resource-intensive tasks
  • Perfect for network reconnaissance

Raspberry Pi Zero

  • Best for lightweight, specific tasks
  • Great for passive monitoring
  • Ideal for physical penetration testing drops
  • Not recommended for heavy computational tasks

Security Hardening

After setup, harden your Kali Pi:

# Change default username (optional)
sudo usermod -l newusername kali
sudo usermod -d /home/newusername -m newusername

# Configure firewall
sudo apt install ufw
sudo ufw enable
sudo ufw allow ssh

# Disable unnecessary services
sudo systemctl disable bluetooth

Common Issues and Solutions

WiFi Not Working

# Check WiFi status
sudo ifconfig wlan0 up
sudo iwconfig wlan0

# Restart WiFi
sudo systemctl restart networking

Overheating

  • Install heatsinks on CPU
  • Use a case with fan
  • Monitor temperature: vcgencmd measure_temp

Slow Performance (Pi Zero)

  • Close unnecessary applications
  • Increase swap space
  • Use lightweight tools
  • Consider upgrading to Pi 4

Project Ideas

Once setup, try these projects:

  1. WiFi Pineapple Alternative - Rogue access point
  2. Network Tap - Passive network monitoring
  3. Portable Dropbox - Physical penetration testing device
  4. Home Lab IDS - Intrusion detection system
  5. Bluetooth Scanner - BLE device discovery

Always ensure you have proper authorization before conducting any security testing. Using these tools on networks or systems you don’t own or have permission to test is illegal.

Conclusion

Your Raspberry Pi is now a fully functional Kali Linux penetration testing platform. The portability and low cost make it perfect for learning, practicing, and conducting authorized security assessments.

For Pi Zero users: While more limited, it’s perfect for specific tasks like physical drops, passive monitoring, or learning basic security concepts.

Stay ethical, stay legal, and happy hacking!

Next Steps