Quick Answer: Download Raspberry Pi Imager, flash Raspberry Pi OS to a microSD card (set username/password during imaging), insert it, power on. SSH in:
ssh [email protected]. Update:sudo apt update && sudo apt upgrade.
Choosing a Raspberry Pi
| Model | CPU | RAM | Best For | Price |
|---|---|---|---|---|
| Pi 5 | Quad 2.4 GHz | 4/8 GB | Desktop, servers, heavy workloads | $60-80 |
| Pi 4B | Quad 1.8 GHz | 2/4/8 GB | All-purpose, most projects | $35-75 |
| Pi 400 | Quad 1.8 GHz | 4 GB | Desktop (keyboard built-in) | $70 |
| Pi Zero 2 W | Quad 1.0 GHz | 512 MB | IoT, simple projects, low power | $15 |
| Pi 3B+ | Quad 1.4 GHz | 1 GB | Basic projects, legacy | $35 |
For most people: Get a Pi 4B (4GB) or Pi 5. They can run Pi-hole, VPN, media server, Docker, and more.
What You Need
| Item | Notes |
|---|---|
| Raspberry Pi board | Any model |
| microSD card | 32GB+ recommended, Class 10 or A2 |
| USB-C power supply | 5V 3A for Pi 4/5 (official PSU recommended) |
| microSD card reader | To flash the OS from your computer |
| Ethernet cable (optional) | More reliable than Wi-Fi for servers |
| Case (optional) | Protects the board, passive cooling recommended |
| HDMI cable (optional) | For desktop use. Micro-HDMI for Pi 4/5 |
Step 1: Flash the Operating System
Using Raspberry Pi Imager (Recommended)
- Download Raspberry Pi Imager on your PC/Mac
- Insert your microSD card
- Open Imager and select:
- Device: Your Pi model
- OS: Raspberry Pi OS (64-bit) — or Lite for headless server
- Storage: Your microSD card
- Click Edit Settings when prompted (or Next → Edit Settings):
- Set hostname:
raspberrypi - Enable SSH: Yes, with password authentication
- Set username/password:
pi/ your password - Configure Wi-Fi: Enter your SSID and password
- Set locale: Your timezone and keyboard layout
- Click Write
Which OS to Choose
| OS | Use Case |
|---|---|
| Raspberry Pi OS (Desktop) | General use with GUI |
| Raspberry Pi OS Lite | Headless server (no desktop, SSH only) |
| Ubuntu Server | Docker, Kubernetes, enterprise tools |
| DietPi | Ultra-lightweight, optimized for servers |
| LibreELEC | Media center (Kodi) |
| Retropie | Retro gaming |
For servers: Use Raspberry Pi OS Lite or Ubuntu Server.
Step 2: First Boot
With Monitor
- Insert microSD into Pi
- Connect HDMI, keyboard, mouse
- Connect power — Pi boots automatically
- Follow on-screen setup wizard
Headless (No Monitor — SSH Only)
- Insert microSD into Pi
- Connect Ethernet (or rely on Wi-Fi configured in Imager)
- Connect power
- Wait 1-2 minutes for first boot
- SSH in:
ssh [email protected]
# or if .local doesn't work, find the IP:
# Check your router's DHCP client list
# or scan your network:
nmap -sn 192.168.1.0/24
Step 3: Initial Configuration
# Update everything first
sudo apt update && sudo apt upgrade -y
# Run the configuration tool
sudo raspi-config
raspi-config Options
| Option | What to Set |
|---|---|
| System Options | Hostname, password, boot behavior |
| Interface Options | Enable SSH, VNC, SPI, I2C, camera |
| Performance | GPU memory split, overclock |
| Localisation | Timezone, locale, keyboard, Wi-Fi country |
| Advanced | Expand filesystem (usually auto), network config |
Set a Static IP
On Raspberry Pi OS Bookworm and newer (NetworkManager):
# Find your connection name
nmcli con show
# Set static IP
sudo nmcli con mod "Wired connection 1" ipv4.addresses 192.168.1.100/24
sudo nmcli con mod "Wired connection 1" ipv4.gateway 192.168.1.1
sudo nmcli con mod "Wired connection 1" ipv4.dns "1.1.1.1 8.8.8.8"
sudo nmcli con mod "Wired connection 1" ipv4.method manual
sudo nmcli con up "Wired connection 1"
Full guide: How to Set Up a Static IP
Step 4: Essential Setup
Set Up SSH Keys (Disable Password Login)
# On your PC/Mac:
ssh-keygen -t ed25519
ssh-copy-id [email protected]
# On the Pi — disable password login:
sudo nano /etc/ssh/sshd_config
# Set: PasswordAuthentication no
sudo systemctl restart ssh
Full guide: SSH Keys Setup
Enable Firewall
sudo apt install ufw -y
sudo ufw allow ssh
sudo ufw enable
Full guide: UFW Cheat Sheet
Install Docker
curl -fsSL https://get.docker.com | sh
sudo usermod -aG docker pi
# Log out and back in
Now you can run any service in Docker. Full guide: Docker Cheat Sheet
Step 5: Monitor Your Pi
# CPU temperature
vcgencmd measure_temp
# CPU/memory usage
htop
# Disk usage
df -h
# System info
neofetch # Install: sudo apt install neofetch
# Uptime
uptime
# Running services
systemctl list-units --type=service --state=running
Overclock (Pi 4/5 only)
Edit /boot/firmware/config.txt:
# Pi 4 mild overclock
over_voltage=2
arm_freq=1800
# Pi 5 mild overclock
arm_freq=2600
Make sure you have cooling (heatsink or fan) before overclocking.
Popular Pi Projects
Network-Wide Ad Blocker (Pi-hole)
curl -sSL https://install.pi-hole.net | bash
Blocks ads for every device on your network. Guide: Pi-hole Setup
VPN Server (WireGuard)
curl -sSL https://raw.githubusercontent.com/SamNet-dev/wg-orchestrator/main/install.sh | sudo bash
Access your home network from anywhere. Guide: WireGuard Setup
Media Server (Jellyfin)
docker run -d --name jellyfin \
-p 8096:8096 \
-v /media:/media \
-v /config/jellyfin:/config \
jellyfin/jellyfin
Stream your movies and music to any device.
Home Automation (Home Assistant)
docker run -d --name homeassistant \
--privileged --restart=unless-stopped \
-v /opt/homeassistant:/config \
-p 8123:8123 \
ghcr.io/home-assistant/home-assistant:stable
Network Monitor (Uptime Kuma)
docker run -d --name uptime-kuma \
-p 3001:3001 \
-v uptime-data:/app/data \
louislam/uptime-kuma
DNS Server
# Pi-hole doubles as a DNS server
# Or run your own recursive resolver with Unbound
sudo apt install unbound -y
Troubleshooting
| Problem | Fix |
|---|---|
| Red light only, no green blinking | SD card not readable. Reflash it |
| Green light blinks but no boot | Corrupted OS. Reflash SD card |
| Can't find Pi on network | Check Wi-Fi credentials. Try Ethernet |
ssh: Connection refused |
SSH not enabled. Reflash with SSH enabled in Imager |
| Slow performance | Check temperature (vcgencmd measure_temp). Add cooling |
| SD card corruption | Use a quality card (Samsung/SanDisk). Consider USB boot |
| Wi-Fi drops randomly | Known issue with some Pi models. Use Ethernet for servers |
apt is slow |
Normal on first run. Pi has limited CPU |
Boot from USB (More Reliable Than SD)
SD cards wear out. For always-on servers, boot from USB SSD:
# Update bootloader
sudo rpi-eeprom-update -a
# Use Raspberry Pi Imager to flash OS to USB drive
# Select the USB drive as storage instead of SD card
# Remove SD card, plug in USB drive, boot
Quick Reference
| Command | What It Does |
|---|---|
ssh [email protected] |
Connect via SSH |
sudo raspi-config |
Configuration tool |
vcgencmd measure_temp |
Check CPU temperature |
sudo apt update && sudo apt upgrade |
Update system |
pinout |
Show GPIO pin layout |
df -h |
Check disk usage |
free -h |
Check memory |
cat /proc/cpuinfo |
CPU information |
hostname -I |
Show IP address |
Related Guides
- Complete Self-Hosting Guide — server basics
- Docker Cheat Sheet — run services in containers
- WireGuard Setup — VPN on your Pi
- UFW Cheat Sheet — firewall
- How to Set Up a Static IP — fixed IP address
- How to Enable SSH — remote access
- How to Set Up a Cron Job — automate tasks
- Server Hardening Guide — secure your Pi