How to install Raspberry Pi OS with Raspberry Pi Imager (and set up SSH headless)

TUREFF• •0
Raspberry Pi Imager is the official, free tool for putting an operating system on a microSD card. It also lets you set your username, Wi-Fi and remote access before the Pi ever boots, which means you can set one up with no screen or keyboard at all.

What you need

  • a Raspberry Pi with a suitable power supply
  • a microSD card (genuine, from a trusted seller)
  • a computer with a card reader
  • Raspberry Pi Imager, downloaded from the official Raspberry Pi website (Windows, macOS and Linux)
Writing the card erases everything on it. Double-check you have the right drive selected, especially if you have USB drives plugged in.

Step by step

  1. Open Raspberry Pi Imager.
  2. Choose your Raspberry Pi model. Imager then shows the operating systems that suit it.
  3. Choose the operating system. Raspberry Pi OS is the standard choice. The full desktop version suits a Pi with a screen; the Lite version has no desktop and is the usual choice for a headless server.
  4. Choose the storage: your microSD card.
  5. Imager offers OS customisation. Use it. Depending on the Imager version this is a separate step in the wizard or a settings button, but the options are the same:
  • a hostname, so you can find the Pi on your network by name
  • a username and password of your choosing
  • Wi-Fi network name, password and the wireless country
  • time zone and keyboard layout
  • SSH, with password or public-key login
  1. Write the card, wait for verification to finish, then eject it.
There is no longer a default username and password on Raspberry Pi OS. You must set your own, here or at first boot. Choose a strong password, particularly if SSH is enabled.

First boot

Put the card in the Pi and connect power. The first boot takes longer than usual while the system expands to fill the card and applies your settings; give it a few minutes and do not pull the power. With a screen, you will land on the desktop or a login prompt. Run the software updater or, in a terminal: sudo apt update sudo apt full-upgrade

Headless setup and SSH

If you enabled SSH and Wi-Fi in Imager, you do not need a screen. Once the Pi has booted:
  1. Make sure your computer is on the same network.
  2. Open a terminal (built into recent Windows, macOS and Linux).
  3. Connect with your username and the hostname you chose, in the form:
ssh yourname@yourhostname.local
  1. Accept the host fingerprint the first time, then enter your password.
If the .local name does not resolve, find the Pi's IP address in your router's list of connected devices and use that instead. Older guides describe enabling SSH by putting an empty file named ssh on the card's boot partition, plus a file to create the user. Raspberry Pi's documentation still describes this as an alternative, but Imager's customisation is simpler and less error-prone.

Securing remote access

  • Use public-key login rather than a password if you can, and keep the private key on your own computer.
  • Keep the system updated.
  • Do not forward SSH from your router to the internet unless you know exactly what you are doing; for remote access from outside, use a VPN instead.

When it will not connect

  • Wi-Fi: check the network name and password, and that the wireless country is set.
  • Some Pi models only support certain Wi-Fi bands; check yours.
  • Plug in an Ethernet cable as a test; if that works, the Wi-Fi settings are the problem.
  • Re-flash the card if in doubt. It only takes a few minutes and rules out a bad write.
Menus and options change between Imager versions, so check the official documentation if a screen looks different. Got stuck at a step, or found a trick that saved you time? Share it in the comments.

Comments (0)