Raspberry Pi Installing the OS

Installing Raspberry Pi OS onto a microSD card with Raspberry Pi Imager is the first hands-on step before your Pi can boot up.

What You Need Before Flashing

  • A microSD card, 8GB minimum, 32GB or larger recommended for the desktop variant
  • A card reader, either built into your computer or a small USB adapter
  • Another computer with internet access to download the imaging tool and OS
  • The Raspberry Pi Imager application, the official tool for writing operating system images to a card

Raspberry Pi OS Variants

Raspberry Pi OS is the official operating system, built on Debian Linux and tuned to run well on Raspberry Pi hardware. It comes in a few flavors depending on how much you want pre-installed. Raspberry Pi Imager also offers other operating systems entirely, from Ubuntu to media-center and retro-gaming distributions, listed under an "Other general-purpose OS" category, but Raspberry Pi OS is the default starting point for most projects and the one this course focuses on.

VariantIncludesBest For
Raspberry Pi OS (with desktop)Full desktop environment, office and coding tools, web browserGeneral use and first-time setup
Raspberry Pi OS LiteCommand-line only, no desktop environmentHeadless servers, robotics, low-resource projects
Raspberry Pi OS FullDesktop plus a larger bundle of recommended applicationsUsers who want most software pre-installed
Other general-purpose OSUbuntu, LibreELEC, RetroPie, and othersSpecialized use cases like media centers or retro gaming

Using Raspberry Pi Imager

  1. Download and install Raspberry Pi Imager on any computer (Windows, macOS, or Linux)
  2. Insert the microSD card using a card reader
  3. Open Imager and click "Choose Device" to select your Raspberry Pi model
  4. Click "Choose OS" and select Raspberry Pi OS or another listed option
  5. Click "Choose Storage" and select the microSD card, double-checking it's the right drive
  6. Click the gear/settings icon to open advanced options before writing, if you want to preconfigure the Pi
  7. Click "Write" and confirm, which erases the card and writes the new image

Flashing From the Command Line (Advanced)

# List attached disks to find the SD card device (double-check the name!)
diskutil list        # macOS
lsblk                 # Linux

# Unmount the card first, then write the downloaded image with dd
sudo dd if=raspios-bookworm-arm64.img of=/dev/sdX bs=4M status=progress conv=fsync

# Flush all buffers before removing the card
sync
Note: The dd command writes over an entire disk with no confirmation prompt. Selecting the wrong device name will silently erase the wrong drive, so triple-check which device corresponds to your microSD card before running it. Raspberry Pi Imager is the safer, recommended route for most people.

Preconfiguring With Advanced Options

Before clicking Write, the gear icon (or Ctrl+Shift+X) in Raspberry Pi Imager opens an advanced options panel. Here you can set a hostname, create a username and password, connect to a specific Wi-Fi network, choose your locale and keyboard layout, and enable SSH ahead of time. Filling these in before the card is even written means a Pi can boot straight onto your network with remote access already available, which is especially useful when there's no spare monitor or keyboard nearby.

Note: Keep the download's checksum handy and verify it against the official value before flashing; a partially corrupted download can produce an image that flashes without error but fails to boot correctly.