Tutorials 8 min read

Create a Raspberry Pi 5 NAS in 2026: Complete Guide

Guide for 2026 to transform a Raspberry Pi 5 into a high-performance NAS. Step-by-step guide on case, NVMe SSD, Docker, Samba setup and security for reliable self-hosting.

See our picks
S By Selfhostr Team · no sponsored content
Create a Raspberry Pi 5 NAS in 2026: Complete Guide
ⓘ ⓘ This article may contain affiliate links (no extra cost to you, it funds the site). As an Amazon Associate, Selfhostr earns from qualifying purchases. See the disclosure.
⏱️
~1h30
Duration
🎚️
Intermediate
Difficulty
💶
Check the live price
Cost
📦
Stable Ethernet connection
Key Prerequisites

👍 What we like

  • ✓Minimal power consumption compared to a desktop PC.
  • ✓Silent and compact, ideal for living room or desk.
  • ✓Massive community for troubleshooting and scripts.
  • ✓NVMe performance far superior to previous generations.

👎 What to watch

  • ✕No native hardware RAID (software only).
  • ✕Limited to 1 GbE on the base model (without dedicated USB 3.0 dongle).
  • ✕Linux learning curve required for beginners.
  • ✕Critical power supply: a cut can corrupt the system.

🏆 Our picks

Affiliate links · same price for you
Recommended
Raspberry Pi 5 8 Go

Raspberry Pi 5 8 Go

Voir sur Amazon

Amazon · price and availability on the listing

Essential
Pimoroni NVMe Base pour Raspberry Pi 5

Pimoroni NVMe Base pour Raspberry Pi 5

Voir sur Amazon

Amazon · price and availability on the listing

System
📦

SanDisk Extreme microSDXC A2 128 Go

Voir sur Amazon

Amazon · price and availability on the listing

See all our recommended gear in the shop.

📑 Contents ▾

In 2026, the Raspberry Pi 5 remains an unbeatable reference to start your homelab without breaking the bank. We will turn this small card into a multi-purpose storage server capable of handling backups, media, and Docker applications. The goal is to exceed microSD limitations by using an NVMe SSD, ensuring speed and reliability. You will learn how to configure a secure Samba share and harden your installation against external threats. This guide avoids common pitfalls such as overheating or permission issues. At the end, you’ll have a self-hosted NAS that is powerful, future-proof, and reliable.

Prerequisites

  • Hardware: Raspberry Pi 5 8 GB (or 16 GB), official 27W USB-C power supply, NVMe base (Pimoroni or equivalent), M.2 2280 NVMe SSD, microSD card for booting.
  • OS: Raspberry Pi OS Lite (64-bit) or minimal Debian 12 Bookworm.
  • Tools: SSH access, web browser, SFTP client (WinSCP/FileZilla).
  • Network: Fixed IP address configured on your router.
  • Knowledge: Basic terminal Linux and Docker skills.

Step-by-step installation

Step 1: Base System Preparation

Start by flashing Raspberry Pi OS Lite onto your microSD card. Use Raspberry Pi Imager to simplify the process. Enable SSH and configure Wi-Fi if necessary via Custom OS Options. Connect the Pi, plug it into Ethernet, and find its IP address through your router. In these options, create the user pi with a strong password: Raspberry Pi OS no longer has a default account or password. Log in via SSH: ssh pi@<IP> with the password set in Imager. Update the system: sudo apt update && sudo apt full-upgrade -y. Reboot if a kernel update was installed. This step is crucial because an outdated system is the primary source of bugs.

Step 2: Installation and Mounting of NVMe SSD

The NVMe base connects the SSD to the Pi over PCIe, which is much faster and more reliable than a microSD. Install the SSD into the base, then connect the base to the Pi 5’s PCIe connector with the supplied ribbon cable (“RPI 5” end on the Pi). Verify detection with lsblk. Identify the disk (e.g., /dev/nvme0n1). Create a partition and an ext4 filesystem: sudo fdisk /dev/nvme0n1 (n for new partition, t for type, w for write). Then sudo mkfs.ext4 /dev/nvme0n1p1. Create a mount point: sudo mkdir -p /mnt/nas. Mount the disk: sudo mount /dev/nvme0n1p1 /mnt/nas. For automatic mounting at boot, add an entry in /etc/fstab: sudo blkid to get the UUID, then edit fstab with sudo nano /etc/fstab by adding UUID=<YOUR_UUID> /mnt/nas ext4 defaults 0 2. Test with sudo mount -a. No error message means it’s good.

Step 3: Installation and Configuration of Docker

Docker is the engine for our future applications. Run the official installation script to avoid version conflicts: curl -fsSL https://get.docker.com | sh. Add user pi to the docker group to avoid using sudo with each command: sudo usermod -aG docker pi. Log out and log back in. Verify with docker --version. Create a folder for Docker configurations: mkdir -p ~/docker/nas. We will create a docker-compose.yml file in this directory to define our infrastructure. This file is the heart of your NAS, defining services, volumes, and networks.

Step 4: Samba Configuration for Network Sharing

To access files from Windows or Mac, Samba is the standard solution. Install it: sudo apt install samba samba-common-bin. Edit the configuration: sudo nano /etc/samba/smb.conf. Add to the end of the file:

[nas]
 path = /mnt/nas
 browseable = yes
 writeable = yes
 valid users = pi
 create mask = 0664
 directory mask = 0775
 force user = pi
 force group = pi

Restart the service: sudo systemctl restart smbd nmbd. Set a Samba password for user pi: sudo smbpasswd -a pi. Test the share from your PC: smbclient //<IP_PI>/nas -U pi. If the connection succeeds, the share is functional. Ensure that /mnt/nas directory permissions are correct: sudo chown -R pi:pi /mnt/nas.

To expose your Docker services via HTTPS, Nginx Proxy Manager is the simplest solution. Create a npm folder in ~/docker/nas. Add this service to your docker-compose.yml:

services:
  npm:
    image: 'jc21/nginx-proxy-manager:latest'
    restart: unless-stopped
    ports:
      - '80:80'
      - '81:81'
      - '443:443'
    volumes:
      - ./npm/data:/data
      - ./npm/letsencrypt:/etc/letsencrypt

Launch docker compose up -d. Access the interface on http://<IP>:81. Log in with admin@example.com / changeme. Configure your domains with Let’s Encrypt certificates. This step is vital to avoid security warnings in your browser.

Step 6: Hardening and Backups

Disable root account: sudo passwd -l root. Configure firewall with UFW: sudo apt install ufw, sudo ufw allow ssh, sudo ufw allow Samba, sudo ufw allow 80/tcp, sudo ufw allow 443/tcp, sudo ufw enable. Enable automatic updates: sudo apt install unattended-upgrades. For backups, use restic or borgbackup to another server or encrypted cloud. Never neglect redundancy. A NAS is not a backup if the disk fails.

Step 7: Power Management and Temperature Control

The Pi 5 can heat up under load. Check temperature with vcgencmd measure_temp. If it exceeds 75°C, add a fan or improve the case. Monitor throttling: vcgencmd get_throttled (0x0 = no throttling). Add a cron rule to monitor SSD health: sudo apt install smartmontools, sudo smartctl -a /dev/nvme0n1. Schedule monthly scans. Unstable power is enemy number one for Pi; always use the official 27W supply.

Step 8: Finalization and Remote Access

Configure port forwarding on your router for ports 80 and 443 (HTTP for Let’s Encrypt validation, then HTTPS). Never expose the Samba port (445) to the internet: use a VPN for remote file access. Use a dynamic DNS service (DuckDNS or Cloudflare) if your IP changes. Test access from an external network. Check logs: sudo journalctl -u smbd -f. Ensure everything works before unplugging the local monitor.

Verification checks

To validate your installation, run docker ps : you should see the Nginx Proxy Manager container in state Up (Samba runs directly on the host: check it with systemctl status smbd). Verify disk mounting with df -h; /mnt/nas must display the size of your SSD. Test network access from another device on LAN by typing \\<IP_OF_PI>\nas in file explorer; if the folder opens and you can create a file, the share is active. For HTTPS, access https://<your-domain> ; the green padlock should appear. Finally, check Samba logs with tail -f /var/log/samba/log.smbd to confirm no permission errors are generated upon connection.

Security and best practices

Security is crucial for an exposed NAS. Always change default passwords. Enable SSH encryption with private keys rather than passwords. Use fail2ban to block brute-force login attempts: sudo apt install fail2ban. For Docker services, isolate networks and expose only necessary ports. Enable 2FA on web interfaces like Nginx Proxy Manager or Portainer. Regularly update Docker images and the operating system. In case of doubt, use a guest network for IoT devices to limit infection spread. Three-two-one backups (3 copies, 2 media, 1 off-site) are non-negotiable.

Troubleshooting common errors

  • Symptom: The SSD is not mounted at boot time. Cause: Incorrect UUID in /etc/fstab or USB detection timeout too long. Fix: Verify the UUID with blkid. If the disk does not appear in lsblk, check that the PCIe ribbon cable is firmly seated at both ends.
  • Symptom: Unable to connect to Samba share. Cause: Missing Samba password for pi user or permission denied. Fix: Re-run smbpasswd -a pi. Ensure the user is listed as a valid user in smb.conf.
  • Symptom: Docker does not create files with correct permissions. Cause: Container user (UID/GID) does not match host user. Fix: Use --user 1000:1000 in docker-compose or adjust volumes with chown.
  • Symptom: Immediate overheating. Cause: Closed case without adequate ventilation or weak power supply. Fix: Install an active fan. Ensure the power supply delivers 5V/5A properly.
  • Symptom: Slow network access from remote devices. Cause: Unstable Wi-Fi or congested USB bus. Fix: Use Ethernet cable exclusively. Verify the NVMe base PCIe ribbon cable is properly seated.

FAQ

Can I use an SD card for data storage?

No, absolutely not. SD cards wear out quickly with frequent database and log writes. Use the microSD only for system booting and put all your data on the NVMe SSD for reliability and speed.

Is Raspberry Pi 5 powerful enough for Plex?

Yes, but with limitations. The Pi 5 can transcode H.264 but struggles without advanced hardware acceleration for H.265/HEVC. It’s excellent for direct streaming. For heavy transcoding, a mini-PC x86 is better suited.

How do I back up my NAS?

The best method involves using tools like Restic or Borg that encrypt and deduplicate data. Configure a cron job to send backups to another remote server or S3-compatible cloud storage. Never rely on software RAID as a substitute for backup.

Can I add a second disk?

Yes, the Pi 5 has several USB 3.0 ports available. You can connect an external SSD drive. However, Raspberry Pi OS does not support hardware RAID. You will need to manage redundancy with software tools like SnapRAID or ZFS (if using a compatible distribution such as Ubuntu Server).

Read also

Tags: raspberry pinasselfhostingdockerhomelab

Related

Tutorials

Metal Rack Assembly for Home Lab 2026: Step-by-Step Guide

Discover our comprehensive and detailed tutorial to install a metal rack in 2026. Follow our practical tips, complete configuration files, and exact commands.

Read
Tutorials

Boot a Raspberry Pi 5 on NVMe SSD in 2026: The Complete Guide

Boot a Raspberry Pi 5 from an NVMe SSD with the official M.2 HAT+: bootloader update, cloning with SD Card Copier or Raspberry Pi Imager, BOOT_ORDER in the EEPROM, and checks.

Read
Tutorials

Build a TrueNAS SCALE NAS in DIY Style for 2026: A Comprehensive Guide

Build a DIY NAS on TrueNAS SCALE (Debian) in 2026: assembly in a Jonsbo N4 or Node 304, install drive, ZFS pool created in the web UI, SMB share, built-in Docker apps and hardening.

Read