Raspberry Pi & Self Hosting

Install the NVMe drive and Raspberry Pi OS

October 3, 2026•Beginner•30–45 min
Beginner30–45 minStep 2

Prepare the NVMe drive as the boot disk and configure the machine so it can be managed remotely from the start.

Goal
After reboot, SSH should work and `findmnt /` should show the NVMe-backed root filesystem.

Step-by-step

01

Install the M.2 HAT+ and NVMe drive

Power the Pi off completely. Install the M.2 HAT+ or compatible adapter according to its hardware instructions, secure the NVMe drive, and reconnect the PCIe ribbon carefully.

02

Flash Raspberry Pi OS

Use Raspberry Pi Imager on another computer. For a headless server, Raspberry Pi OS Lite 64-bit is a good choice. Select the NVMe device as the destination if your adapter is connected to the computer, or prepare it from a temporary Pi installation.

03

Preconfigure hostname and login

In Imager customization, set a hostname such as pi-web, create a non-default username, set a strong password, configure your time zone, and enable SSH. Prefer an SSH public key when you are comfortable using one.

04

Boot from the NVMe drive

Insert or connect the NVMe device and start the Pi. Raspberry Pi 5 can boot from NVMe when the bootloader and boot order are configured appropriately. If an SD card is still inserted, it may be tried first depending on boot order.

05

Verify the root filesystem is on NVMe

After logging in, use lsblk and findmnt to confirm that the running root filesystem is on the NVMe device, not an SD card.

lsblk
findmnt /
06

Update the operating system

Install current package updates before adding server software.

sudo apt update
sudo apt full-upgrade -y
sudo reboot
Verify before moving on
After reboot, SSH should work and `findmnt /` should show the NVMe-backed root filesystem.

Troubleshooting

If the Pi will not boot from NVMe, temporarily boot from SD, update the bootloader, and check the boot order rather than repeatedly re-imaging the drive.

What you learned

You now understand the purpose of this part of the system and have a concrete result you can verify before continuing to the next lesson.