Build a DIY Raspberry Pi NAS Server Guide

DIY Hardware
Date:September 22, 2026
Topic:
Build a DIY Raspberry Pi NAS Server Guide
3 min read

Your cloud subscription just renewed. Again. You're paying monthly rent for data you already own, stored on hardware you'll never touch. There's a better way: build a NAS with a Raspberry Pi, own the stack, and pay once.

Why a Pi NAS Makes Sense

A Raspberry Pi 4 or 5 with 4GB+ RAM handles file serving, media streaming, and backups for a typical household. It sips 5-10W idle versus 50W+ for an old desktop. The trade-off? Single USB 3.0 bus bandwidth and no native SATA. We'll work around both.

💡
TipPi 5 + official M.2 HAT + NVMe SSD delivers 900 MB/s sequential. That's 3x faster than USB 3.0 and changes what's possible.

Hardware Checklist

ComponentRecommended SpecNotes
SBCRaspberry Pi 5 (4GB/8GB)Pi 4 4GB works but slower I/O
StorageNVMe SSD (M.2 HAT) or 2x USB 3.0 HDDsNVMe for OS/apps, HDDs for bulk
PowerOfficial 27W USB-C PD supplyUndervoltage kills stability
CoolingActive cooler or case with fanThrottling kills performance
NetworkGigabit Ethernet (built-in)Add USB 2.5GbE adapter for speed
Boot Media32GB+ microSD (A2 rated)Only for bootloader; OS lives on NVMe

Software: OpenMediaVault on Debian

OpenMediaVault (OMV) gives you a web UI, Docker plugin, SMB/NFS, and ZFS support. Flash Raspberry Pi OS Lite (64-bit) to the microSD, boot, then install OMV via script.

bash
sudo apt update && sudo apt upgrade -y
wget -O - https://github.com/OpenMediaVault-Plugin-Developers/installScript/raw/master/install | sudo bash
⚠️
WarningRun the install script on a fresh Pi OS Lite. Existing Docker/Portainer installs will conflict.

Storage Layout: ZFS Mirror for Safety

With two identical USB HDDs, create a ZFS mirror. It protects against single-drive failure and offers snapshots for ransomware recovery. NVMe holds the OS and Docker volumes; HDDs hold user data.

bash
# Identify disks (e.g., sda, sdb)
lsblk -o NAME,SIZE,MODEL,SERIAL
# Create mirror pool
sudo zpool create -f -o ashift=12 tank mirror /dev/disk/by-id/usb-Drive1 /dev/disk/by-id/usb-Drive2
# Create datasets
sudo zfs create tank/media
sudo zfs create tank/backups
sudo zfs set compression=lz4 tank
ℹ️
NoteAlways use /dev/disk/by-id/ paths. USB port order changes on reboot; by-id stays constant.

Essential Docker Services

Enable the OMV Docker plugin (Compose v2). Deploy these via Portainer or the OMV Compose file editor:

ServicePurposeKey Config
Samba/NFSNative file sharesOMV handles this natively, no Docker needed
JellyfinMedia serverHardware transcoding via V4L2 on Pi 5
ImmichPhotos backupMobile apps auto-upload; ML runs on CPU
Paperless-ngxDocument archiveOCR + search; great for receipts
Uptime KumaMonitoringAlerts if NAS or internet goes down
TailscaleRemote accessNo port forwarding; MagicDNS for local names

Backup Strategy: 3-2-1 on a Budget

Local ZFS snapshots (hourly via sanoid) cover accidental deletion. Push encrypted borgbackup to Backblaze B2 or rsync.net for offsite. Total cost: ~$5/month for 1TB offsite.

bash
# Install sanoid for automated snapshots
sudo apt install -y sanoid
# Configure /etc/sanoid.conf for hourly/daily retention
# Install borg + rclone for offsite
pipx install borgbackup rclone


Your First Weekend Project

Order the Pi 5, M.2 HAT, NVMe, and two 4TB USB drives today. Flash Pi OS, run the OMV script, create the ZFS mirror, deploy Jellyfin and Immich. By Sunday night you'll have a media server, photo backup, and document archive — all yours, no subscription. Next weekend: add Tailscale and offsite borg. The cloud bill stops now.

Share𝕏 Twitterin LinkedInin Whatsapp