Raspberry Pi Guide
When to Use
Process
Gather requirements. Ask the user clarifying questions about their specific context, goals, constraints, and experience level.
Analyze the situation. Review the information provided and identify key factors, challenges, and opportunities relevant to raspberry pi guide.
Develop the framework. Create a structured approach tailored to the user's needs, incorporating best practices and domain-specific considerations.
Deliver actionable output. Present specific, implementable recommendations with clear rationale, timelines, and success criteria.
Address edge cases. Proactively identify potential issues, alternative approaches, and contingency plans.
Use this skill when:
- User needs guidance on raspberry pi guide
- User asks about raspberry pi guide best practices or techniques
- User wants a structured approach to raspberry pi guide
Do NOT use this skill when:
- A more specialized skill exists for the specific subtopic
- The request is outside the scope of raspberry pi guide
Questions to Ask First
Before recommending a setup, I need to understand your goals:
- What do you want to build? (Media server, NAS, retro gaming, home automation, learning Linux, web server, IoT)
- What is your experience with Linux and the command line? (None / Basic / Comfortable / Expert)
- Do you have programming experience? In which languages?
- What is your budget? ($50 / $100 / $200+)
- Do you need GPIO pins for physical computing projects?
- Will this run 24/7 as a server, or be used intermittently?
- Do you need desktop GUI access, or is headless (no monitor) fine?
- What networking do you need? (Ethernet only / WiFi / Both)
Model Selection Guide
Raspberry Pi 5 (Current Flagship)
- CPU: Broadcom BCM2712, quad-core Cortex-A76 @ 2.4GHz
- RAM: 2GB, 4GB, or 8GB options
- Key features: PCIe 2.0 connector, dual 4K HDMI, USB 3.0, hardware video decode
- Best for: Desktop replacement, media servers, Docker hosting, development
- Power: USB-C, requires 5V 5A (27W) official power supply
- Cost: $60 (2GB) to $80 (8GB)
Raspberry Pi 4 Model B
- CPU: Broadcom BCM2711, quad-core Cortex-A72 @ 1.8GHz
- RAM: 1GB, 2GB, 4GB, or 8GB
- Best for: Still excellent for most projects, widely supported, mature ecosystem
- Power: USB-C, 5V 3A recommended
- Cost: $35-75 depending on RAM
Raspberry Pi Zero 2 W
- CPU: Quad-core Cortex-A53 @ 1GHz
- RAM: 512MB
- Best for: Small embedded projects, IoT sensors, Pi-hole, lightweight tasks
- Key features: WiFi, Bluetooth, tiny form factor
- Power: Micro-USB, very low power consumption
- Cost: $15
Raspberry Pi Pico / Pico W
- Note: This is a microcontroller, NOT a Linux computer
- Best for: Arduino-style projects, sensor reading, motor control
- Programming: MicroPython or C/C++
- Cost: $4-6
Which Model to Choose
| Use Case |
Recommended Model |
RAM |
| First Pi / Learning |
Pi 5 or Pi 4 |
4GB |
| Media server (Plex/Jellyfin) |
Pi 5 |
8GB |
| NAS |
Pi 5 |
4GB+ |
| Pi-hole (ad blocking) |
Pi Zero 2 W |
512MB |
| Retro gaming (RetroPie) |
Pi 4 or Pi 5 |
4GB |
| Home automation |
Pi 4 |
2-4GB |
| Docker host |
Pi 5 |
8GB |
| Desktop replacement |
Pi 5 |
8GB |
| IoT sensor node |
Pi Zero 2 W or Pico W |
- |
OS Setup
Step 1: Download Raspberry Pi Imager
- Download from raspberrypi.com/software
- Available for Windows, macOS, and Linux
- This is the official and easiest way to flash OS images
Step 2: Flash the OS
- Insert microSD card into computer (32GB minimum, 64GB recommended, Class 10 / A2)
- Open Raspberry Pi Imager
- Choose OS: Raspberry Pi OS (64-bit) for most users
- Choose Storage: Select your microSD card
- Click the gear icon for advanced options:
- Set hostname (e.g., mypi.local)
- Enable SSH (important for headless setup)
- Set username and password
- Configure WiFi (SSID and password)
- Set locale and timezone
- Click Write and wait for completion
Step 3: First Boot
With monitor: Insert SD card, connect HDMI, keyboard, mouse, power on
Headless (no monitor):
- Insert SD card and power on
- Wait 2-3 minutes for first boot
- Connect via SSH:
connect-to hostname.local (or use IP address)
- Find IP address from router admin page if .local doesn't resolve
Step 4: Initial Configuration
update-packages && upgrade-packages -y
system-config-tool # Configure additional settings
Key system-config-tool options:
- Interface Options: Enable VNC, SPI, I2C, Serial as needed
- Performance Options: Set GPU memory split
- Localization: Timezone, keyboard layout
Alternative Operating Systems
- Ubuntu Server - For serious server use, better Docker support
- LibreELEC - Dedicated Kodi media center OS
- RetroPie - Retro gaming emulation
- Home Assistant OS - Dedicated smart home OS
- DietPi - Minimal, optimized, very lightweight
Project Guides
Project 1: Pi-hole (Network-Wide Ad Blocker)
Difficulty: Beginner | Time: 30 minutes | Best on: Pi Zero 2 W or any Pi
Start with fresh Raspberry Pi OS Lite installation
Assign static IP address:
nmcli con mod "Wired connection 1" ipv4.addresses 192.168.1.100/24
nmcli con mod "Wired connection 1" ipv4.gateway 192.168.1.1
nmcli con mod "Wired connection 1" ipv4.method manual
Install Pi-hole:
Security Note: Piping scripts directly from the internet to an interpreter (request | run-installer) executes unverified code. For production systems, download the script first, inspect it, then execute it. These commands are shown for convenience in hobby/development contexts only.
request -sSL [URL] | run-installer
Follow the installer prompts
Set your router's DNS to the Pi's IP address
Access admin panel at [URL]
Add additional blocklists for better coverage
Project 2: Media Server (Jellyfin)
Difficulty: Beginner-Intermediate | Time: 1 hour | Best on: Pi 4 (4GB) or Pi 5
- Install Jellyfin (see security note above about
request | run-installer patterns):install-package request gnupg
request -fsSL [URL] | run-installer
- Connect external USB drive with media files
- Auto-mount the drive:
blkid # Find drive UUID
mkdir /mnt/media
# Add to [system-path] UUID=xxxx /mnt/media ext4 defaults,nofail 0 2
mount -a
- Access Jellyfin at [URL]
- Add media libraries pointing to /mnt/media subdirectories
- Install Jellyfin apps on TV, phone, tablet for playback
Project 3: NAS (Network Attached Storage)
Difficulty: Intermediate | Time: 2 hours | Best on: Pi 4 or Pi 5
- Connect USB drives (consider USB 3.0 enclosure with RAID)
- Install OpenMediaVault:
download -O - [URL] | run-installer
- Access OMV web interface at [URL]
- Configure storage: Create filesystems, shared folders
- Enable SMB/CIFS for Windows shares or NFS for Linux
- Set up user accounts and permissions
- Configure scheduled backups with rsync
Project 4: Retro Gaming (RetroPie)
Difficulty: Beginner | Time: 1-2 hours | Best on: Pi 4
- Flash RetroPie image using Raspberry Pi Imager
- Connect controllers (USB or Bluetooth)
- Boot and configure controller mapping in EmulationStation
- Transfer ROMs via USB, SFTP, or Samba share
- Supported systems: NES, SNES, Genesis, N64, PS1, GBA, Arcade, and many more
- Configure shaders for CRT-like appearance
- Scrape game metadata for cover art and descriptions
Project 5: Home Automation (Home Assistant)
Difficulty: Intermediate-Advanced | Time: 2-4 hours | Best on: Pi 4 or Pi 5
- Flash Home Assistant OS using Raspberry Pi Imager (choose "Other" > "Home Assistant")
- Boot and wait 5-10 minutes for initial setup
- Access at [URL]
- Create account and configure location
- Auto-discovery finds compatible smart devices
- Add integrations: Zigbee (with USB dongle), Z-Wave, WiFi devices
- Create automations: motion-triggered lights, temperature-based fan control
- Build dashboards for room-by-room control
GPIO Basics
Pin Layout (40-pin header)
- 3.3V and 5V power pins - Power external components
- Ground pins - 8 ground pins available
- GPIO pins - General Purpose Input/Output, 3.3V logic
- Special function pins: I2C (SDA/SCL), SPI (MOSI/MISO/SCLK/CE), UART (TX/RX)
Important GPIO Rules
- GPIO pins are 3.3V logic - NEVER connect 5V directly to a GPIO pin
- Maximum current per pin: 16mA (safe), some sources say up to 50mA total across all pins
- Use level shifters for 5V devices
- Use transistors or relays for high-power loads
Python GPIO Programming (gpiozero library)
from gpiozero import LED, Button
from signal import pause
led = LED(17) # LED on GPIO 17
button = Button(2) # Button on GPIO 2
button.when_pressed = led.on
button.when_released = led.off
pause() # Keep program running
Common GPIO Projects
- LED control and PWM dimming
- Button and switch input
- Temperature/humidity sensors (DHT22, BME280)
- Relay control for appliances
- Servo and stepper motor control
- OLED and LCD displays
- NeoPixel / WS2812B LED strips
- PIR motion sensors
- Ultrasonic distance sensors
Python Programming on Pi
Essential Libraries
install-package python3-pip python3-venv
python3 -m venv myproject
source myproject/bin/activate
install-python-package gpiozero RPi.GPIO requests flask
Useful Python Packages for Pi
- gpiozero - Simple GPIO interface
- RPi.GPIO - Lower-level GPIO control
- picamera2 - Camera module interface
- Flask - Web server for dashboards
- MQTT (paho-mqtt) - IoT messaging
- Adafruit CircuitPython libraries - Sensor support
- schedule - Task scheduling
- psutil - System monitoring
Docker on Raspberry Pi
Installation
Security Note: Piping scripts directly from the internet to an interpreter (request | run-installer) executes unverified code. For production systems, download the script first, inspect it, then execute it.
request -fsSL [URL] | run-installer
usermod -aG docker $USER
# Log out and back in
docker run hello-world # Test installation
Docker Compose
install-package docker-compose-plugin
Recommended Docker Containers for Pi
- Portainer - Docker management GUI
- Pi-hole - DNS ad blocking
- Nginx Proxy Manager - Reverse proxy with SSL
- Heimdall - Application dashboard
- Uptime Kuma - Service monitoring
- Grafana + InfluxDB - Data visualization
- Mosquitto - MQTT broker for IoT
- Watchtower - Auto-update containers
Performance Tips for Docker on Pi
- Use images built for arm64 architecture
- Limit container memory with
--memory flag
- Use bind mounts instead of named volumes for better I/O
- Monitor with
docker stats
- Consider an SSD instead of SD card for heavy I/O workloads
Remote Access
SSH (Secure Shell)
# From another computer:
connect-to raspberrypi.local
# Or use IP address:
connect-to 192.168.1.100
VNC (Remote Desktop)
- Enable VNC:
system-config-tool > Interface Options > VNC
- Install RealVNC Viewer on your computer
- Connect using hostname.local or IP address
Tailscale (Remote Access from Anywhere)
Security Note: Review scripts before piping to interpreter. Download first with request -fsSL [URL] -o install-script, inspect, then run.
request -fsSL [URL] | run-installer
tailscale up
- Creates secure VPN tunnel without port forwarding
- Access Pi from anywhere using Tailscale IP
File Transfer
- SCP:
scp file.txt user@pi:/home/user/
- SFTP: Use FileZilla or WinSCP with SFTP protocol
- rsync:
rsync -avz folder/ user@pi:/backup/ (incremental sync)
- Samba: Mount Pi folders as network drives on Windows/Mac
Maintenance and Optimization
SD Card Health
- SD cards have limited write cycles; they will eventually fail
- Use
log2ram to reduce writes: keeps logs in RAM
- Consider booting from USB SSD for reliability and speed
- Always shut down properly:
shutdown -h now
- Keep backups of your SD card image
Performance Optimization
- Overclock carefully (Pi 5 supports it well with active cooling)
- Use 64-bit OS for 4GB+ RAM models
- Disable unnecessary services:
systemctl disable bluetooth if unused
- Use lightweight desktop (LXDE) or go headless
- Monitor temperature:
vcgencmd measure_temp
- Add heatsinks and fan for sustained workloads
Security Hardening
- Change default password immediately
- Use SSH keys instead of passwords
- Disable password SSH login after setting up keys
- Keep system updated:
update-packages && apt upgrade
- Install and configure UFW firewall
- Change SSH port from default 22
- Use fail2ban to block brute-force attempts
Backup Strategy
- Image entire SD card periodically (use Raspberry Pi Imager or dd)
- Back up specific config files with rsync
- Use version control (git) for custom scripts
- Document your setup so you can recreate from scratch
Troubleshooting
Pi Won't Boot
- Check power supply (official supply recommended, undervoltage causes issues)
- Re-flash SD card
- Try a different SD card
- Check HDMI connection (try other HDMI port on Pi 4/5)
- Look for steady green LED (means SD card is being read)
Network Issues
- Check WiFi credentials in imager settings
- Use
nmcli or system-config-tool to reconfigure network
- For Ethernet, check cable and router DHCP settings
ip addr shows current IP addresses
ping google.com tests internet connectivity
Performance Issues
- Check temperature: overheating causes throttling
- Check CPU usage:
htop
- Check disk space:
df -h
- Check memory:
free -h
- Lightning bolt icon on desktop = insufficient power supply
Output Format
Deliver the response as a structured document with clear headings and actionable content. Use tables for comparisons, numbered lists for sequential steps, and bullet points for options. Include specific examples where applicable.
[Raspberry Pi Guide deliverable]
1. Context and objectives
2. Analysis or framework
3. Specific recommendations with rationale
4. Action items with timeline
Example
Input: "Help me with raspberry pi guide for a mid-size project."
Output: A complete raspberry pi guide framework tailored to the specific context, with actionable steps, relevant considerations, and measurable outcomes.
1---2name: raspberry-pi-guide3description: Comprehensive guide to Raspberry Pi projects including model selection, OS setup, server builds, GPIO programming, home automation, and advanced applications. Use when the user asks about raspberry pi guide or needs help with related topics. Do NOT use for unrelated domains or when a more specialized skill exists.4license: Apache-2.05---67# Raspberry Pi Guide89## When to Use101112## Process13141. **Gather requirements.** Ask the user clarifying questions about their specific context, goals, constraints, and experience level.15162. **Analyze the situation.** Review the information provided and identify key factors, challenges, and opportunities relevant to raspberry pi guide.17183. **Develop the framework.** Create a structured approach tailored to the user's needs, incorporating best practices and domain-specific considerations.19204. **Deliver actionable output.** Present specific, implementable recommendations with clear rationale, timelines, and success criteria.21225. **Address edge cases.** Proactively identify potential issues, alternative approaches, and contingency plans.2324**Use this skill when:**25- User needs guidance on raspberry pi guide26- User asks about raspberry pi guide best practices or techniques27- User wants a structured approach to raspberry pi guide2829**Do NOT use this skill when:**30- A more specialized skill exists for the specific subtopic31- The request is outside the scope of raspberry pi guide3233## Questions to Ask First3435Before recommending a setup, I need to understand your goals:36371. What do you want to build? (Media server, NAS, retro gaming, home automation, learning Linux, web server, IoT)382. What is your experience with Linux and the command line? (None / Basic / Comfortable / Expert)393. Do you have programming experience? In which languages?404. What is your budget? ($50 / $100 / $200+)415. Do you need GPIO pins for physical computing projects?426. Will this run 24/7 as a server, or be used intermittently?437. Do you need desktop GUI access, or is headless (no monitor) fine?448. What networking do you need? (Ethernet only / WiFi / Both)4546## Model Selection Guide4748### Raspberry Pi 5 (Current Flagship)49- **CPU**: Broadcom BCM2712, quad-core Cortex-A76 @ 2.4GHz50- **RAM**: 2GB, 4GB, or 8GB options51- **Key features**: PCIe 2.0 connector, dual 4K HDMI, USB 3.0, hardware video decode52- **Best for**: Desktop replacement, media servers, Docker hosting, development53- **Power**: USB-C, requires 5V 5A (27W) official power supply54- **Cost**: $60 (2GB) to $80 (8GB)5556### Raspberry Pi 4 Model B57- **CPU**: Broadcom BCM2711, quad-core Cortex-A72 @ 1.8GHz58- **RAM**: 1GB, 2GB, 4GB, or 8GB59- **Best for**: Still excellent for most projects, widely supported, mature ecosystem60- **Power**: USB-C, 5V 3A recommended61- **Cost**: $35-75 depending on RAM6263### Raspberry Pi Zero 2 W64- **CPU**: Quad-core Cortex-A53 @ 1GHz65- **RAM**: 512MB66- **Best for**: Small embedded projects, IoT sensors, Pi-hole, lightweight tasks67- **Key features**: WiFi, Bluetooth, tiny form factor68- **Power**: Micro-USB, very low power consumption69- **Cost**: $157071### Raspberry Pi Pico / Pico W72- **Note**: This is a microcontroller, NOT a Linux computer73- **Best for**: Arduino-style projects, sensor reading, motor control74- **Programming**: MicroPython or C/C++75- **Cost**: $4-67677### Which Model to Choose78| Use Case | Recommended Model | RAM |79|----------|------------------|-----|80| First Pi / Learning | Pi 5 or Pi 4 | 4GB |81| Media server (Plex/Jellyfin) | Pi 5 | 8GB |82| NAS | Pi 5 | 4GB+ |83| Pi-hole (ad blocking) | Pi Zero 2 W | 512MB |84| Retro gaming (RetroPie) | Pi 4 or Pi 5 | 4GB |85| Home automation | Pi 4 | 2-4GB |86| Docker host | Pi 5 | 8GB |87| Desktop replacement | Pi 5 | 8GB |88| IoT sensor node | Pi Zero 2 W or Pico W | - |8990## OS Setup9192### Step 1: Download Raspberry Pi Imager93- Download from raspberrypi.com/software94- Available for Windows, macOS, and Linux95- This is the official and easiest way to flash OS images9697### Step 2: Flash the OS981. Insert microSD card into computer (32GB minimum, 64GB recommended, Class 10 / A2)992. Open Raspberry Pi Imager1003. Choose OS: Raspberry Pi OS (64-bit) for most users1014. Choose Storage: Select your microSD card1025. Click the gear icon for advanced options:103 - Set hostname (e.g., mypi.local)104 - Enable SSH (important for headless setup)105 - Set username and password106 - Configure WiFi (SSID and password)107 - Set locale and timezone1086. Click Write and wait for completion109110### Step 3: First Boot111**With monitor**: Insert SD card, connect HDMI, keyboard, mouse, power on112**Headless (no monitor)**:1131. Insert SD card and power on1142. Wait 2-3 minutes for first boot1153. Connect via SSH: `connect-to hostname.local` (or use IP address)1164. Find IP address from router admin page if .local doesn't resolve117118### Step 4: Initial Configuration119```120update-packages && upgrade-packages -y121system-config-tool # Configure additional settings122```123Key system-config-tool options:124- Interface Options: Enable VNC, SPI, I2C, Serial as needed125- Performance Options: Set GPU memory split126- Localization: Timezone, keyboard layout127128### Alternative Operating Systems129- **Ubuntu Server** - For serious server use, better Docker support130- **LibreELEC** - Dedicated Kodi media center OS131- **RetroPie** - Retro gaming emulation132- **Home Assistant OS** - Dedicated smart home OS133- **DietPi** - Minimal, optimized, very lightweight134135## Project Guides136137### Project 1: Pi-hole (Network-Wide Ad Blocker)138**Difficulty**: Beginner | **Time**: 30 minutes | **Best on**: Pi Zero 2 W or any Pi1391401. Start with fresh Raspberry Pi OS Lite installation1412. Assign static IP address:142 ```143 nmcli con mod "Wired connection 1" ipv4.addresses 192.168.1.100/24144 nmcli con mod "Wired connection 1" ipv4.gateway 192.168.1.1145 nmcli con mod "Wired connection 1" ipv4.method manual146 ```1473. Install Pi-hole:148149 > **Security Note:** Piping scripts directly from the internet to an interpreter (`request | run-installer`) executes unverified code. For production systems, download the script first, inspect it, then execute it. These commands are shown for convenience in hobby/development contexts only.150151 ```152 request -sSL [URL] | run-installer153 ```1544. Follow the installer prompts1555. Set your router's DNS to the Pi's IP address1566. Access admin panel at [URL]1577. Add additional blocklists for better coverage158159### Project 2: Media Server (Jellyfin)160**Difficulty**: Beginner-Intermediate | **Time**: 1 hour | **Best on**: Pi 4 (4GB) or Pi 51611621. Install Jellyfin (see security note above about `request | run-installer` patterns):163 ```164 install-package request gnupg165 request -fsSL [URL] | run-installer166 ```1672. Connect external USB drive with media files1683. Auto-mount the drive:169 ```170 blkid # Find drive UUID171 mkdir /mnt/media172 # Add to [system-path] UUID=xxxx /mnt/media ext4 defaults,nofail 0 2173 mount -a174 ```1754. Access Jellyfin at [URL]1765. Add media libraries pointing to /mnt/media subdirectories1776. Install Jellyfin apps on TV, phone, tablet for playback178179### Project 3: NAS (Network Attached Storage)180**Difficulty**: Intermediate | **Time**: 2 hours | **Best on**: Pi 4 or Pi 51811821. Connect USB drives (consider USB 3.0 enclosure with RAID)1832. Install OpenMediaVault:184 ```185 download -O - [URL] | run-installer186 ```1873. Access OMV web interface at [URL]1884. Configure storage: Create filesystems, shared folders1895. Enable SMB/CIFS for Windows shares or NFS for Linux1906. Set up user accounts and permissions1917. Configure scheduled backups with rsync192193### Project 4: Retro Gaming (RetroPie)194**Difficulty**: Beginner | **Time**: 1-2 hours | **Best on**: Pi 41951961. Flash RetroPie image using Raspberry Pi Imager1972. Connect controllers (USB or Bluetooth)1983. Boot and configure controller mapping in EmulationStation1994. Transfer ROMs via USB, SFTP, or Samba share2005. Supported systems: NES, SNES, Genesis, N64, PS1, GBA, Arcade, and many more2016. Configure shaders for CRT-like appearance2027. Scrape game metadata for cover art and descriptions203204### Project 5: Home Automation (Home Assistant)205**Difficulty**: Intermediate-Advanced | **Time**: 2-4 hours | **Best on**: Pi 4 or Pi 52062071. Flash Home Assistant OS using Raspberry Pi Imager (choose "Other" > "Home Assistant")2082. Boot and wait 5-10 minutes for initial setup2093. Access at [URL]2104. Create account and configure location2115. Auto-discovery finds compatible smart devices2126. Add integrations: Zigbee (with USB dongle), Z-Wave, WiFi devices2137. Create automations: motion-triggered lights, temperature-based fan control2148. Build dashboards for room-by-room control215216## GPIO Basics217218### Pin Layout (40-pin header)219- **3.3V and 5V power pins** - Power external components220- **Ground pins** - 8 ground pins available221- **GPIO pins** - General Purpose Input/Output, 3.3V logic222- **Special function pins**: I2C (SDA/SCL), SPI (MOSI/MISO/SCLK/CE), UART (TX/RX)223224### Important GPIO Rules225- GPIO pins are 3.3V logic - NEVER connect 5V directly to a GPIO pin226- Maximum current per pin: 16mA (safe), some sources say up to 50mA total across all pins227- Use level shifters for 5V devices228- Use transistors or relays for high-power loads229230### Python GPIO Programming (gpiozero library)231```python232from gpiozero import LED, Button233from signal import pause234235led = LED(17) # LED on GPIO 17236button = Button(2) # Button on GPIO 2237238button.when_pressed = led.on239button.when_released = led.off240241pause() # Keep program running242```243244### Common GPIO Projects245- LED control and PWM dimming246- Button and switch input247- Temperature/humidity sensors (DHT22, BME280)248- Relay control for appliances249- Servo and stepper motor control250- OLED and LCD displays251- NeoPixel / WS2812B LED strips252- PIR motion sensors253- Ultrasonic distance sensors254255## Python Programming on Pi256257### Essential Libraries258```259install-package python3-pip python3-venv260python3 -m venv myproject261source myproject/bin/activate262install-python-package gpiozero RPi.GPIO requests flask263```264265### Useful Python Packages for Pi266- **gpiozero** - Simple GPIO interface267- **RPi.GPIO** - Lower-level GPIO control268- **picamera2** - Camera module interface269- **Flask** - Web server for dashboards270- **MQTT (paho-mqtt)** - IoT messaging271- **Adafruit CircuitPython libraries** - Sensor support272- **schedule** - Task scheduling273- **psutil** - System monitoring274275## Docker on Raspberry Pi276277### Installation278279> **Security Note:** Piping scripts directly from the internet to an interpreter (`request | run-installer`) executes unverified code. For production systems, download the script first, inspect it, then execute it.280281```282request -fsSL [URL] | run-installer283usermod -aG docker $USER284# Log out and back in285docker run hello-world # Test installation286```287288### Docker Compose289```290install-package docker-compose-plugin291```292293### Recommended Docker Containers for Pi294- **Portainer** - Docker management GUI295- **Pi-hole** - DNS ad blocking296- **Nginx Proxy Manager** - Reverse proxy with SSL297- **Heimdall** - Application dashboard298- **Uptime Kuma** - Service monitoring299- **Grafana + InfluxDB** - Data visualization300- **Mosquitto** - MQTT broker for IoT301- **Watchtower** - Auto-update containers302303### Performance Tips for Docker on Pi304- Use images built for arm64 architecture305- Limit container memory with `--memory` flag306- Use bind mounts instead of named volumes for better I/O307- Monitor with `docker stats`308- Consider an SSD instead of SD card for heavy I/O workloads309310## Remote Access311312### SSH (Secure Shell)313```314# From another computer:315connect-to raspberrypi.local316# Or use IP address:317connect-to 192.168.1.100318```319320### VNC (Remote Desktop)3211. Enable VNC: `system-config-tool` > Interface Options > VNC3222. Install RealVNC Viewer on your computer3233. Connect using hostname.local or IP address324325### Tailscale (Remote Access from Anywhere)326327> **Security Note:** Review scripts before piping to interpreter. Download first with `request -fsSL [URL] -o install-script`, inspect, then run.328329```330request -fsSL [URL] | run-installer331tailscale up332```333- Creates secure VPN tunnel without port forwarding334- Access Pi from anywhere using Tailscale IP335336### File Transfer337- **SCP**: `scp file.txt user@pi:/home/user/`338- **SFTP**: Use FileZilla or WinSCP with SFTP protocol339- **rsync**: `rsync -avz folder/ user@pi:/backup/` (incremental sync)340- **Samba**: Mount Pi folders as network drives on Windows/Mac341342## Maintenance and Optimization343344### SD Card Health345- SD cards have limited write cycles; they will eventually fail346- Use `log2ram` to reduce writes: keeps logs in RAM347- Consider booting from USB SSD for reliability and speed348- Always shut down properly: `shutdown -h now`349- Keep backups of your SD card image350351### Performance Optimization352- Overclock carefully (Pi 5 supports it well with active cooling)353- Use 64-bit OS for 4GB+ RAM models354- Disable unnecessary services: `systemctl disable bluetooth` if unused355- Use lightweight desktop (LXDE) or go headless356- Monitor temperature: `vcgencmd measure_temp`357- Add heatsinks and fan for sustained workloads358359### Security Hardening360- Change default password immediately361- Use SSH keys instead of passwords362- Disable password SSH login after setting up keys363- Keep system updated: `update-packages && apt upgrade`364- Install and configure UFW firewall365- Change SSH port from default 22366- Use fail2ban to block brute-force attempts367368### Backup Strategy3691. Image entire SD card periodically (use Raspberry Pi Imager or dd)3702. Back up specific config files with rsync3713. Use version control (git) for custom scripts3724. Document your setup so you can recreate from scratch373374## Troubleshooting375376### Pi Won't Boot377- Check power supply (official supply recommended, undervoltage causes issues)378- Re-flash SD card379- Try a different SD card380- Check HDMI connection (try other HDMI port on Pi 4/5)381- Look for steady green LED (means SD card is being read)382383### Network Issues384- Check WiFi credentials in imager settings385- Use `nmcli` or `system-config-tool` to reconfigure network386- For Ethernet, check cable and router DHCP settings387- `ip addr` shows current IP addresses388- `ping google.com` tests internet connectivity389390### Performance Issues391- Check temperature: overheating causes throttling392- Check CPU usage: `htop`393- Check disk space: `df -h`394- Check memory: `free -h`395- Lightning bolt icon on desktop = insufficient power supply396397398## Output Format399400Deliver the response as a structured document with clear headings and actionable content. Use tables for comparisons, numbered lists for sequential steps, and bullet points for options. Include specific examples where applicable.401402```403[Raspberry Pi Guide deliverable]4041. Context and objectives4052. Analysis or framework4063. Specific recommendations with rationale4074. Action items with timeline408```409410411## Example412413**Input:** "Help me with raspberry pi guide for a mid-size project."414415**Output:** A complete raspberry pi guide framework tailored to the specific context, with actionable steps, relevant considerations, and measurable outcomes.