Installing Raspberry Pi OS Bookworm on a Pi 4 and Completing First Boot
A Raspberry Pi 4 does nothing until it has an operating system on a microSD card or USB drive. The official choice is Raspberry Pi OS, a Debian-based distribution tuned for the board. The Bookworm release (based on Debian 12) changed several things that older tutorials get wrong: there is no default pi user, the boot partition is mounted at /boot/firmware, networking is handled by NetworkManager, and the desktop runs on Wayland.
In this guide you will flash the card with Raspberry Pi Imager, preconfigure your user, Wi-Fi and SSH so the Pi works even without a monitor, and then complete the essential first-boot tasks: updating, setting the Indian locale and timezone, and giving the board a fixed IP address.
What You Need
| Item | Recommendation | Why |
|---|---|---|
| microSD card | 32 GB, Class 10 / A1 or A2 rated | A1/A2 cards handle small random writes better |
| Card reader | USB or laptop slot | To flash the card from your PC |
| Power supply | 5.1 V 3 A USB-C | Prevents under-voltage resets |
| Display (optional) | Monitor with micro-HDMI cable | Only for the desktop route |
| Network | Wi-Fi details or an Ethernet cable | Needed for updates and SSH |
Which Image to Pick
- Raspberry Pi OS (64-bit) with desktop: the normal choice if you will connect a monitor or use VNC.
- Raspberry Pi OS Lite (64-bit): no desktop, smaller and faster to update. Best for servers, Docker, NAS and headless GPIO projects.
- Raspberry Pi OS Full: desktop plus extra applications such as LibreOffice. Rarely needed.
Flashing the Card with Raspberry Pi Imager
- Download and install Raspberry Pi Imager on Windows, macOS or Linux from the official Raspberry Pi website.
- Insert the microSD card and open Imager. Choose Raspberry Pi 4 as the device.
- Choose the operating system, for example Raspberry Pi OS (64-bit) or Lite (64-bit).
- Choose the storage: select your microSD card carefully. Everything on it will be erased.
- Click Next. When asked about OS customisation, choose Edit Settings.
- On the General tab set a hostname (for example
pi4lab), a username and a strong password, your Wi-Fi SSID and password, the wireless LAN country (IN) and your timezone (Asia/Kolkata). - On the Services tab tick Enable SSH and choose password authentication for now.
- Save, confirm, and wait for writing and verification to finish. Eject the card.
First Boot
Insert the card into the slot on the underside of the Pi and connect power last. The first boot takes a little longer because the system expands the root filesystem to fill the card and applies your custom settings. The green ACT LED flickers while the card is being read. If you attached a monitor, the desktop appears after one or two automatic reboots.
For a headless board, wait a couple of minutes and then connect from your PC. Windows 10 and 11 include an OpenSSH client, so this works from PowerShell or Command Prompt:
ssh yourname@pi4lab.local # if .local name lookup fails, find the IP in your router's client list ssh yourname@192.168.1.42
Type yes to accept the host key the first time, then enter the password you set in Imager.
Essential First-Boot Commands
Run the following script line by line, or save it as a file and run it with bash. It updates the system, checks key settings and gives the wired connection a static address with NetworkManager's nmcli tool, which replaced dhcpcd.conf in Bookworm.
#!/bin/bash
# first_boot.sh - run once on a fresh Raspberry Pi OS Bookworm install
# Usage: bash first_boot.sh
set -e # stop on the first error
# 1. Update package lists and upgrade everything, including firmware packages
sudo apt update
sudo apt full-upgrade -y
# 2. Confirm we are on 64-bit Bookworm
uname -m # should print aarch64
grep VERSION_CODENAME /etc/os-release # should print bookworm
# 3. Set timezone and locale non-interactively using raspi-config
sudo raspi-config nonint do_change_timezone Asia/Kolkata
sudo raspi-config nonint do_change_locale en_IN.UTF-8
# 4. Show the network connections NetworkManager knows about
nmcli connection show
# 5. Give the wired connection a static IPv4 address.
# Change the addresses to suit your own router.
CON='Wired connection 1'
sudo nmcli connection modify "$CON" \
ipv4.method manual \
ipv4.addresses 192.168.1.50/24 \
ipv4.gateway 192.168.1.1 \
ipv4.dns '192.168.1.1 8.8.8.8'
# 6. Re-apply the connection so the new address takes effect
sudo nmcli connection up "$CON"
# 7. Show the result
hostname -I
echo 'Done. Reboot with: sudo reboot'
If you are connected over SSH through that same Ethernet link, step 6 will drop your session when the address changes. Simply reconnect to the new IP. For a Wi-Fi connection, use the connection name shown by nmcli connection show, which is usually your network's SSID.
Where Configuration Files Live in Bookworm
| File | Bookworm path | Purpose |
|---|---|---|
| config.txt | /boot/firmware/config.txt | Firmware settings, overlays, overclocking |
| cmdline.txt | /boot/firmware/cmdline.txt | Kernel command line, single line only |
| Network profiles | /etc/NetworkManager/system-connections/ | Saved Wi-Fi and Ethernet settings |
| Swap size | /etc/dphys-swapfile | CONF_SWAPSIZE setting |
Troubleshooting First Boot
- No display at all: use HDMI0, the micro-HDMI port next to USB-C, and plug the monitor in before powering the Pi.
- Green LED does not flicker: the card is not readable. Reflash it and let Imager complete verification.
- pi4lab.local not found: some Windows networks block mDNS. Use the IP address from your router instead.
- Permission denied over SSH: Bookworm has no default
pi/raspberrylogin. Use the username you created in Imager. - apt update fails: check the date with
date. A wrong clock breaks HTTPS repositories; it corrects itself once network time sync works. - Old tutorial says edit /boot/config.txt: on Bookworm that file only points you to
/boot/firmware/config.txt.
Summary
Raspberry Pi Imager's customisation screen lets you set the user, Wi-Fi, SSH and timezone before the first boot, so a Pi 4 can run headless from minute one. After booting, update with apt full-upgrade, confirm you are on 64-bit Bookworm, and use nmcli for a fixed IP address. Remember the new paths under /boot/firmware; nearly every later article in this series edits config.txt there.