Skip to main content

How to Create a File Server using Raspberry Pi 5

In The MagPi 134, Alasdair Allan, Head of Documentation, expressed excitement about the possibility of low-power NAS boxes utilizing the M.2 HAT on the Raspberry Pi 5. Here are the basic steps for setting up a file server.

01. Software setup #

Begin by installing Samba onto Raspberry Pi OS with the following command:

sudo apt install samba samba-common-bin

To ensure compatibility with other operating systems, install NTFS for the shared drive:

sudo apt install ntfs-3g

02. Storage setup #

While an external hard drive is typically used, using an SSD drive is similar. Plug in the SSD drive, format it if necessary, and mount it to Raspberry Pi OS. To automount the drive on boot, edit the fstab file with the command sudo nano /etc/fstab and add a line similar to the following:

/dev/sdb1 /mnt/location ntfs nls-utf8,umask-0222,uid-1000,gid-1000,rw 0 0

03. Configuration #

The Samba configuration file is where the magic happens, allowing you to open up shared storage to the network. Here is an example configuration:

[share]
Comment = Network share
Path = /mnt/location
Browseable = yes
Writeable = yes
only guest = no
create mask = 0777
directory mask = 0777
Public = yes
Guest ok = yes

By following these steps, you can build a file server using the Raspberry Pi 5 and take advantage of its new features for a more efficient NAS setup.

Source: News - Raspberry Pi.