← How-Tos
raspberry-pi Apr 4, 2026 ◑ 10 views ◯ 3 min read

Raspberry Pi: Complete Headless Setup Guide (No Monitor Needed)

raspberry pisshheadlessnetworkingsetuplinux

Setting up a Raspberry Pi without a monitor, keyboard, or mouse is the cleanest way to deploy one. This guide goes from bare card to a fully accessible Pi on your network โ€” including static IP, SSH key auth, and firewall basics.

What You Need

Step 1: Flash with the Right Settings

Open Imager. For headless deployment, choose Raspberry Pi OS Lite (64-bit) โ€” no desktop, less RAM usage, faster boot. Before writing, click the gear icon or press Ctrl+Shift+X to open Advanced Options. Configure:

Write the image. Safely eject. Do not manually add a ssh file to the card โ€” Imager handles it through firstrun.sh on modern OS versions.

Step 2: Boot and Find the Pi

Insert card, plug in Ethernet if using it, apply power. First boot takes 60โ€“90 seconds โ€” the Pi expands the filesystem and applies your config. Once it's up, find its IP address:

  1. Hostname ping: ping pi-shop.local โ€” works if your router supports mDNS (most modern routers do)
  2. Router DHCP table: Log into your router admin panel, check lease list for a new device
  3. Network scan: nmap -sn 192.168.1.0/24 โ€” adjust subnet to match yours

Step 3: SSH In and Update

ssh [email protected]

Accept the host fingerprint. Enter your password. Once in, immediately update:

sudo apt update && sudo apt full-upgrade -y sudo reboot

After reboot, SSH back in. Your Pi is now running current packages.

Step 4: Switch to SSH Key Authentication

On your local machine, generate a key pair if you don't have one:

ssh-keygen -t ed25519 -C "pi-shop"

Copy your public key to the Pi:

ssh-copy-id [email protected]

Test that key auth works before disabling passwords:

ssh -i ~/.ssh/id_ed25519 [email protected]

Once confirmed, disable password auth. Edit /etc/ssh/sshd_config:

PasswordAuthentication no ChallengeResponseAuthentication no PubkeyAuthentication yes sudo systemctl restart ssh

Step 5: Set a Static IP

Best approach: DHCP reservation on your router. Get the Pi's MAC address:

ip link show eth0 # or wlan0 for WiFi

Enter that MAC in your router's static lease table with your chosen IP. The Pi always gets the same address without any config on the Pi itself โ€” cleaner and easier to change later.

Alternative: Static config on the Pi. Edit /etc/dhcpcd.conf:

interface eth0 static ip_address=192.168.1.50/24 static routers=192.168.1.1 static domain_name_servers=1.1.1.1 8.8.8.8

Reboot to apply. Reconnect using the new IP.

Step 6: Firewall and Essentials

sudo apt install -y ufw vim tmux htop curl git sudo ufw allow ssh sudo ufw enable sudo ufw status

UFW (Uncomplicated Firewall) blocks everything except SSH by default. Add more rules as needed โ€” sudo ufw allow 80/tcp for a web server, sudo ufw allow 1883/tcp for MQTT, etc.

Troubleshooting