A Raspberry Pi lab, with or without a Pi
Set up a Raspberry Pi headless with Raspberry Pi OS, connect to it over SSH and use GPIO safely, and learn what you can still practise on a normal Linux machine if you do not have the hardware yet.
What you need
A Raspberry Pi is a small, cheap computer that runs Linux and has pins (GPIO) for connecting sensors and LEDs. The Pi courses use it for Linux skills and for physical computing.
If you do not have a Pi yet, you can still learn most of the Linux and Python material on an Ubuntu VM (see the Linux lab guide), and use a browser simulator for the wiring ideas. Buy the Pi when you reach the hardware projects.
With a Pi you need: the board, a good-quality power supply of the right rating (weak supplies cause strange crashes), a microSD card (16 GB or more), and a card reader.
Set it up
- On your computer, install Raspberry Pi Imager from raspberrypi.com.
- Insert the microSD card, choose your Pi model, choose Raspberry Pi OS (the Lite version is perfect for headless work), and choose the card.
- Open the Imager’s settings (the cog) before writing: set a host name, a user name and password, your Wi-Fi details and country, and enable SSH. This lets the Pi come up ready to use without a screen or keyboard.
- Write the card, put it in the Pi and power it on. Wait a couple of minutes.
- From your computer:
ssh youruser@yourhostname.local(or use its address from your router’s device list). - Update it:
sudo apt update && sudo apt full-upgrade -y.
Check that it works
- You can sign in over SSH and
hostnameshows the name you chose. cat /etc/os-releaseshows Raspberry Pi OS, andvcgencmd measure_tempshows a temperature.pinout(if installed) draws the pin diagram, and a short Python script using the gpiozero library blinks an LED (with a resistor) on a pin.
If it will not join Wi-Fi, check the country and password in the settings, or use an Ethernet cable for the first boot.
Practise safely
- GPIO pins are 3.3 V and cannot supply much current. Always use a resistor with an LED, never connect a pin directly to 5 V, and use a transistor or relay module for anything bigger than a small LED.
- Never connect mains voltage to the Pi or to bare wiring; use ready-made, safety-rated modules and adult supervision for anything beyond low voltage.
- Shut the Pi down properly (
sudo shutdown now) before pulling the power; sudden power loss can corrupt the card. - Change the default password, keep SSH to your home network, and do not expose the Pi to the internet.
- Keep a backup image of a working card so a mistake costs minutes.
Go further
- Read a sensor with Python and log the values to a file, then view the log with
tail -f. - Run a small web page or API on the Pi and reach it from your phone on the same network.
- Create a service that starts your script at boot and restarts it if it fails (a systemd unit), then test by rebooting.
- Practise remote work:
scpa file, edit withnanoover SSH, and schedule a job withcron.
Courses that use this lab
Other lab guides
- A virtual machine lab on your own computer
- A Linux practice machine
- A network lab with free simulators and virtual routers
- A packet-capture lab with Wireshark and tcpdump
- A network-services lab: DHCP, DNS, proxy, load balancer, time and failover
- A Windows Server and Active Directory lab
- A developer workstation: editor, Git, Python and Node
- A container and Kubernetes lab
- A monitoring lab with Prometheus and Grafana
- A security operations (SOC) practice lab
- An isolated security lab for authorised practice
- A cloud lab that cannot surprise you with a bill
- An embedded and microcontroller lab: simulators first, hardware second
- An electronics lab: simulate first, then build on a breadboard
- A home automation lab with Home Assistant and MQTT
- An audio, video, streaming and show-control lab
- A data lab: Python, pandas and Jupyter on your own computer
- A machine learning lab: scikit-learn, notebooks and honest experiments
- An LLM lab: a free local model, embeddings and a test harness
- A TypeScript lab: Node.js, the compiler and a test runner
- A web deployment lab: Git, a free host and environment settings
Software changes quickly. Menu names and version numbers may differ a little from what you see; the ideas and the check at the end of each section stay the same. Always download from the project's own website, and read the licence terms for your situation.