We’ve built a NAS and Docker Staging environment using a Raspberry Pi 5. Our NAS features a 2 TB NVMe SSD drive for fast shared storage on our network.
Raspberry Pi NAS Hardware Components
We use the following components to build our system –
- Raspberry Pi 5 SBC with 8 GB memory
- Geekworm X1001 PCIe NVMe SSD PIP PCIe Board
- Samsung 980 PRO SSD with Heatsink 2TB PCIe Gen 4 NVMe M.2 SSD
- GeekPi Aluminum Case for Raspberry Pi 5, with Active Cooler
- CanaKit 45W USB-C Power Supply (27W @ 5A)
- A 32 GB microSDHC Flash Card to enable the initial OS installation
Here’s a photo of the completed hardware assembly –
Software Components and Installation
We installed the following software on our system to create our NAS –
- Raspberry Pi OS 64-bit Lite Version – for system configuration and general applications
- CasaOS – for docker environment and container applications
CassaOS
CasaOS is included to add a very nice GUI for managing each of our NUT servers. Here’s a useful video on how to install CasaOS on the Raspberry Pi –
Installation
The first step is to install the 64-bit Lite Version of Raspberry Pi OS. This is done by first installing a full desktop version on a flash card and then using Raspberry Pi Imager to install the lite version on our NVMe drive.
Once this installation was done, we used the Raspberry Pi Imager to install the same OS version on our NVMe SSD. After removing the flash card and booting to the NVMe SSD, the following configuration changes were made –
- The system name is set to NAS-12
- Enabled SSH
- Set our user ID and password
- Applied all available updates
- We updated /boot/firmware/config.txt to enable PCIe Gen3 operation with our SSD
We used the process covered in the video above to install CasaOS.
CasaOS makes all of its shares public and does not password-protect shared folders. While this may be acceptable for home use where the network is isolated from the public Internet, it certainly is not a good security practice.
Fortunately, the Debian Linux-derived distro we are running includes Samba file share support, which we can use to protect our shares properly. This article explains the basics of how to do this.
Here’s an example of the information in smb.conf for one of our shares –
[Public] path = /DATA/Public browsable = yes writeable = Yes create mask = 0644 directory mask = 0755 public = no comment = "General purpose public share"
You will also need to create a Samba user for your Samba shares to work. Samba user privileges can be added to any of the existing Raspberry Pi OS users with the following command –
# sudo smbpasswd -a <User ID to add>
It’s also important to correctly set the shared folder’s owner, group, and modes.
We need to restart the Samba service anytime configuration changes are made. This can be done with the following command –
# sudo systemctl restart smbd