Raspberry Pi Mastery

Setting Up a Raspberry Pi

30 min

A Raspberry Pi is a small, low-power Linux computer. Unlike a microcontroller (Arduino Track), it runs a full operating system, so it can host web servers, databases, home automation, media servers and Python projects while also controlling electronics through its GPIO pins.

Choosing a model

Model Good for
Raspberry Pi 5 / 4 servers, desktops, Home Assistant, heavier projects
Raspberry Pi Zero 2 W small, low-power projects with Wi-Fi
Raspberry Pi Pico (microcontroller) Arduino-style electronics, not Linux

Use the official power supply (under-powered Pis behave erratically) and a quality microSD card, or better, boot from an SSD on Pi 4/5 for speed and reliability.

Flashing the OS

  1. Install Raspberry Pi Imager on your computer.
  2. Choose your model, Raspberry Pi OS (Lite for headless servers) and the storage device.
  3. In the customisation settings: set a hostname, create your own username and a strong password, configure Wi-Fi and enable SSH with public-key authentication.
  4. Write, insert the card and power on.

Connecting

ssh panda@pi.local            # or the IP address from your router
sudo apt update && sudo apt full-upgrade -y

Securing the Pi

Everything from the Linux System Administration track applies:

  • Key-only SSH, no password logins.
  • Automatic security updates (unattended-upgrades).
  • A firewall (ufw) allowing only what you use.
  • Do not expose it directly to the internet; use a VPN (WireGuard, Tailscale) for remote access instead of port forwarding.

Exercise

Flash Raspberry Pi OS Lite with SSH keys and a custom user, update it, enable unattended-upgrades and ufw allowing only SSH, and confirm you can log in with your key only.

Check yourself

  • What is the difference between a Raspberry Pi and an Arduino?
  • Why use the official power supply?
  • Why prefer a VPN over port forwarding?

I tuoi progressi sono salvati solo in questo browser.

Invia per la revisione (10 punti)