A Raspberry Pi is a popular choice for the box that runs a smart home: a broker, Zigbee2MQTT, Node-RED, an automation platform, maybe a small database. It uses little power and takes little space. When a Pi-based setup dies, though, the cause is rarely the processor. It is usually the SD card, the power supply or heat. This guide covers the hardware choices that make the difference between a Pi that runs for years and one that needs rescuing every few months, with numbers from the official Raspberry Pi documentation.
Storage: the most common point of failure
Why SD cards fail in servers
A home server writes constantly: logs, database updates, MQTT persistence, state files. SD cards are built for cameras that write large files occasionally, not for a steady stream of small random writes. Flash memory wears out with writes, and cheap cards handle wear and sudden power loss poorly. The typical symptom is a system that will not boot after a power cut, or a file system that turns read-only.
Raspberry Pi's own documentation is blunt about this: "SD card quality is a critical factor in determining the overall user experience". The official Raspberry Pi SD cards carry the A2 application performance class and support command queueing. On a Pi 5 they reach 5,000 read and 2,000 write IOPS for 4 kB random data, according to the specifications. If you stay on SD, buy a good A2 card from a known brand, not the cheapest one available.
Better: an SSD
For a server that runs around the clock, boot from an SSD instead:
- Raspberry Pi 5: use an NVMe drive on the M.2 HAT+ (which takes 2230 and 2242 drives) or the M.2 HAT+ Compact (2230 only). The interface is a single PCIe 2.0 lane with a 500 MB/s peak, which is more than a home server needs. The official 256 GB Raspberry Pi SSD is rated at 40,000 read and 70,000 write IOPS for 4 kB random data, an order of magnitude above the SD card.
- Raspberry Pi 4 and 3B+: boot from a USB SSD in a good enclosure. USB host boot is available on all models since the Pi 3B+.
The gap in random write performance is what matters most for a database-backed automation system: faster writes mean shorter periods in which a power cut can catch a write half-done.
Booting a Pi 5 from NVMe
The official procedure, in short:
- Update the system:
sudo apt update && sudo apt full-upgrade. Check the bootloader withsudo rpi-eeprom-update. If it is older than 6 December 2023, select Advanced Options > Bootloader Version > Latest insudo raspi-configand runsudo rpi-eeprom-update -a, then reboot. - Power off and fit the M.2 HAT+ and the drive. Always disconnect power before plugging or unplugging an M.2 device.
- Check the drive is detected:
ls -l /dev/nvme*should list/dev/nvme0and/dev/nvme0n1. - Write Raspberry Pi OS to the NVMe drive with Raspberry Pi Imager, which you can run on the Pi itself.
- Remove the SD card, or set Advanced Options > Boot Order > NVMe/USB boot in
raspi-configso the Pi does not try the SD card first.
You can enable PCIe Gen 3 for higher speed, but the documentation warns that the Pi 5 is not certified for it and connections might be unstable. For a server, stability is worth more than the extra speed.
Power: use the right supply
Under-voltage causes random crashes, USB devices that disconnect and file system corruption, and it is hard to diagnose because the Pi often keeps running. Recommended supplies, from the official documentation:
| Model | Recommended supply | Maximum total USB current |
|---|---|---|
| Raspberry Pi 4 | 3.0 A (5.1 V, USB-C) | 1.2 A |
| Raspberry Pi 5 | 5.0 A (27 W USB-C supply) | 1.6 A, or 600 mA with a 3 A supply |
The Pi 5 detail is easy to miss. With a phone charger or any supply that cannot deliver 5 A at 5 V, the Pi 5 limits all USB devices together to 600 mA. A USB SSD plus a Zigbee coordinator can exceed that. Use the official 27 W supply or one that explicitly supports the 5 V, 5 A mode. Also note that no Raspberry Pi model supports USB-PPS.
To see whether the Pi has had power problems, run vcgencmd get_throttled. A result other than throttled=0x0 means under-voltage or throttling has happened since boot.
A small UPS or a power bank with pass-through charging protects against short outages, but the bigger win is making sure writes are safe when the power does go: an SSD, a journaling file system (the default ext4 is fine) and backups.
Heat: keep it out of throttling
All Pi models manage their own temperature. According to the documentation, the Arm cores are throttled progressively between 80 and 85 °C, and at 85 °C both the CPU and GPU slow down. Throttling protects the chip, so a heatsink is not required to prevent damage, but a server that throttles every afternoon in a sunny cupboard is a slow server.
- On a Pi 5, fit the Active Cooler or use the official case with its fan. If you also plan an NVMe drive, note that the Active Cooler fits under the standard M.2 HAT+ but not under the Compact version.
- Do not put the Pi in a closed cabinet next to a router and a NAS without airflow.
- Check the temperature with
vcgencmd measure_tempduring a busy period.
The smaller details
- Real-time clock. The Pi 5 has a built-in RTC that can be backed by a rechargeable coin cell on the J5 connector. Without it, the clock is wrong after a power cut until the network time is available, which affects logs and time-based automations that run right after boot. Charging of the battery is disabled by default and has to be enabled.
- Ethernet, not Wi-Fi. A server should be on a cable. It removes a whole class of connection problems and frees the radio.
- USB radio adapters. Plug Zigbee or Thread adapters into a short USB extension cable, away from USB 3 ports and the SSD, which can interfere with 2.4 GHz radios.
- Backups off the device. An SSD fails less often than an SD card, but it still fails. Copy configuration and data to another machine or a NAS on a schedule.
When to choose something other than a Pi
If you plan to run many containers, a local voice assistant or video analysis, compare the price of a complete Pi 5 kit (board, SSD, HAT, case, cooler and 27 W supply) with a small x86 mini PC with an internal SSD. The difference is often smaller than it looks, and the mini PC has more headroom. A Pi remains a good fit for a compact, low-power server with a handful of services.