In short: The boring choice is Raspberry Pi's own M.2 HAT+ with a Raspberry Pi SSD, or the SSD Kit that bundles the two with the header for an Active Cooler. Leave the link at its default Gen 2 speed: Raspberry Pi does not certify the Pi 5 for Gen 3. A 256 GB drive is plenty for an agent that calls a cloud model.
| Connector on the Pi 5 | FPC ribbon socket, PCIe Gen 2.0 x1 (5 GT/s); needs an M.2 HAT or another adapter |
|---|---|
| M.2 HAT+ | M key, 2230 or 2242 drives, 500 MB/s peak transfer rate, up to 3 A to the drive |
| M.2 HAT+ Compact | M key, 2230 drives only; fits around the fan of the official case, not over an Active Cooler |
| Raspberry Pi SSD | 256 GB, 512 GB or 1 TB; M.2 2230; PCIe Gen 3 compliant; NVMe 1.4 |
| Gen 3 speed | 8 GT/s with dtparam=pciex1_gen=3; not certified on the Pi 5, may be unstable |
| Boot from NVMe | BOOT_ORDER=0xf416 in the bootloader config, or Boot Order in raspi-config |
Which HAT: HAT+, HAT+ Compact or the SSD Kit
Raspberry Pi makes two M.2 boards for the Pi 5 and sells one of them in a kit with its own drive. All three use the M key edge connector, which is the one NVMe drives use. The difference is the drive length they take and what fits underneath.
| Board | Drive sizes | Cooling underneath | Good for |
|---|---|---|---|
| M.2 HAT+ | 2230 and 2242 | Sits above the board; the SSD Kit version ships a 16 mm stacking header for an Active Cooler | Most agent hosts, and the widest choice of drives |
| M.2 HAT+ Compact | 2230 only | Designed to fit around the fan of the official Raspberry Pi 5 case; the Active Cooler cannot go beneath it | A Pi that lives in the official case |
| SSD Kit | Ships with a Raspberry Pi SSD (2230) | Includes the 16 mm stacking header, spacers and screws so it fits with an Active Cooler | One purchase, nothing to match |
A 2280 drive, the long size most desktop SSDs use, is not among the sizes either HAT takes. If you already own one, a third-party adapter can carry it, but then it is not a HAT+ device and the boot settings below need one more line. Raspberry Pi also notes that only certain devices support PCIe devices behind a switch, so boards that split the lane into two slots are a gamble we would skip for an always-on host.
Which SSD, and what the SD card gives you instead
Any 2230 or 2242 M key NVMe drive goes in the M.2 HAT+. Raspberry Pi's own SSD is the drive with published figures for this board. Its documentation gives 4 kB random IOPS per capacity, and the official microSD card's figures on a Pi 5 for comparison:
| Storage (Raspberry Pi's figures) | 4 kB random read IOPS | 4 kB random write IOPS |
|---|---|---|
| Raspberry Pi SSD 256 GB | 40,000 | 70,000 |
| Raspberry Pi SSD 512 GB | 50,000 | 90,000 |
| Raspberry Pi SSD 1 TB | 90,000 | 90,000 |
| Raspberry Pi microSD card, on a Pi 5 (SDR104) | 5,000 | 2,000 |
Small random writes are what an agent does all day: logs, a SQLite database, session files, Docker layers. That is where the gap is widest. Raspberry Pi publishes no endurance (TBW) figure for its SSDs, so we cannot compare wear between drives. For capacity: an agent with a cloud model fits easily in 256 GB; take 512 GB or 1 TB only if you plan to keep local model files on the board, and see how much SSD space local models need before you decide. The drive runs at the Pi's PCIe 2.0 speed whatever it is rated for, so a fast Gen 4 drive buys nothing here.
Gen 2 or Gen 3: leave it at Gen 2
By default the Pi 5 runs the link at Gen 2.0 speed, 5 GT/s, which the M.2 HAT+ documentation gives as a 500 MB/s peak transfer rate. You can force Gen 3.0 (8 GT/s) with one line in /boot/firmware/config.txt:
dtparam=pciex1_gen=3or in raspi-config under Advanced Options, PCIe Speed. Raspberry Pi's warning comes with both: "The Raspberry Pi 5 isn't certified for Gen 3.0 speeds. PCIe Gen 3.0 connections might be unstable." Its performance page is blunter: forcing the higher rate "can lead to data corruption or system instability if the connected HAT or ribbon cable can't handle the increased frequency", and it advises against the setting unless a HAT requires it.
For an agent host the choice is easy. The agent spends its time waiting on the network and on the model provider, not reading the disk at full speed, and a corrupted system disk costs far more than a faster boot saves. That is our reading of the workload, not a measurement: keep Gen 2.
Fitting it and booting from it
The steps, in order, as Raspberry Pi documents them:
- Disconnect the Pi from power before you connect or disconnect anything in the M.2 slot.
- Seat the ribbon cable fully and evenly: at the Pi end with the metal contacts facing the USB ports, at the HAT end with the copper contacts facing up.
- Update first. Run
sudo apt update && sudo apt full-upgrade, thensudo rpi-eeprom-update: the bootloader should date from 6 December 2023 or later. If it is older, choose Latest under Bootloader Version inraspi-config, runsudo rpi-eeprom-update -aand reboot. - Check the drive is seen, booted from the SD card:
ls -l /dev/nvme*should list/dev/nvme0and/dev/nvme0n1. A new, unformatted drive does not appear as an icon on the desktop, which is normal. - Write Raspberry Pi OS (64-bit) to the NVMe drive with Raspberry Pi Imager.
- Set the boot order. With no SD card inserted, the Pi 5 boots from the NVMe drive on its own. Otherwise pick an option that includes NVMe under Advanced Options, Boot Order in
raspi-config, or edit the bootloader config withsudo rpi-eeprom-config --editand set:
BOOT_ORDER=0xf416The 6 in that value is NVMe boot mode. A non-HAT+ adapter also needs PCIE_PROBE=1 in the same file, and dtparam=pciex1 (alias nvme) in config.txt, because the connector is only enabled on its own for HAT+ devices. If the drive still does not appear, go through the checks in order.
Power: the drive draws from the Pi
The M.2 HAT+ supplies up to 3 A to the drive, and that power comes through the Pi. Raspberry Pi recommends its 27 W USB-C supply for the Pi 5 (5.1 V, 5 A). A 3 A supply boots the board, but the firmware then restricts USB peripherals to 600 mA instead of 1.6 A and warns you about it at boot. With an NVMe drive, a cooler and the odd USB device on one board, use the 5 A supply (27 W supply on Amazon). Raspberry Pi adds that low quality supplies can corrupt storage, which is the failure the SSD was meant to remove. The message and its fix are on the Pi 5 power supply warning.
For cooling: an agent with a cloud model keeps the CPU mostly idle, but the Pi 5 starts throttling at 80 °C and the Active Cooler is cheap insurance under a HAT+ with the stacking header (Active Cooler on Amazon). With the Compact HAT in the official case, the case fan does that job.
What to buy
- Raspberry Pi M.2 HAT+: 2230 and 2242 drives, M key, up to 3 A to the drive; check whether the listing is the HAT+, the Compact or the SSD Kit.
- Raspberry Pi SSD, M.2 2230: the drive with published IOPS for this board; 256 GB for a cloud-model agent.
- Raspberry Pi Active Cooler: goes under the full-size HAT+ with the 16 mm stacking header, not under the Compact.
- Raspberry Pi 27 W USB-C supply: 5 A at 5.1 V, so the drive and USB devices get their full budget.
Shop links go through /go/ and open Amazon (amazon.fr in the EU and Switzerland, amazon.com elsewhere). As an Amazon Associate we earn from qualifying purchases. Your price does not change and no brand pays for a place on this page (disclosure). We write no price down: it moves, the shop shows today's.
Questions
Does the Raspberry Pi 5 support NVMe without a HAT?
Can I use a 2280 SSD on the Raspberry Pi M.2 HAT+?
Should I enable PCIe Gen 3 on the Pi 5?
Can I keep the Active Cooler with an M.2 HAT?
Which capacity of Raspberry Pi SSD should I buy?
Sources
- Raspberry Pi documentation, M.2 HAT+, read on 21 November 2026.
- Raspberry Pi documentation, SSDs, read on 21 November 2026.
- Raspberry Pi documentation, SSD Kit, read on 21 November 2026.
- Raspberry Pi documentation source, PCIe (pcie.adoc), read on 21 November 2026.
- Raspberry Pi documentation source, NVMe SSD boot (boot-nvme.adoc), read on 21 November 2026.
- Raspberry Pi documentation source, performance options (performance.adoc), read on 21 November 2026.
- Raspberry Pi documentation source, USB bus and power (usb-bus-on-raspberry-pi.adoc), read on 21 November 2026.
- Raspberry Pi documentation source, SD cards (about.adoc), read on 21 November 2026.