There are multiple ways to share files from a NAS to different client devices in the homelab, since 95% of my infrastructure uses linux or macos NFS shares made the most sense to me.
Here is a quick setup to get started, this setup purposedly ommits security settings (I am the less qualified person to give security advise)
Installing the nfs server and creating the shares
Install nfs-server:
sudo apt install nfs-kernel-server
Edit the exports file:
sudo nano /etc/exports
Create the shares:
Here I want to set up a share for proxmox backups:
# path to folder # proxmmox ip # share options
/mnt/backups/proxmox 192.168.121.100(rw,sync,no_subtree_check,no_root_squash)
Load the configuration:
sudo exportfs -ra
Add the shared folder to proxmox
Log into your Proxmox web UI
Go to Datacenter (top of the left sidebar)
Click Storage → Add → NFS\
Fill in the fields:
ID: nas-backups (just a name or any name)
Server: 192.168.11.201 -> nfs server ip address
Export: /mnt/pool/backups (should auto-populate from a dropdown)
Content: select VZDump backup file (and any others you want like Disk image, ISO etc.)
Nodes: you can leave it as all nodes or restrict it
Click Add
General Shares for other linux machines
This will allow other machines to connect to the shared folders. There are two ways to do this:
- Allow access to the shares to any machine in the subnet range specified, this setup works for a homelab specially with proxmox.
- Restrict access to the shares by ip address, this is a more secure way to do things and is recommended for production in non-homelab environments.
Allow access to all machines in a subnet:
sudo nano /etc/exports
# shared folder # subnet # options
/mnt/flash-storage 192.168.121.0/24(rw,sync,no_subtree_check,no_root_squash)
Reload the configuration:
sudo exportfs -ra
Restrict acceess to a specific IP Adress:
sudo nano /etc/exports
# shared folder # client ip address # options
/mnt/cold-storage 192.168.130.10/32(rw,sync,no_subtree_check,no_root_squash,fsid=0)
Note: cold-storage is a mergerfs pool, I need to add the fsid=0 valuo for nfs to mount it correctly
Reload the configuration:
sudo exportfs -ra
Start and enable the service:
sudo systemctl enable --now nfs-kernel-server
Verify shares are being exported:
sudo exportfs -v
Accessing the shares from client machines
Install the nfs packages needed:
sudo apt update && sudo apt install nfs-common -y
Testing the mounts manually
Create the local folder to moun the shares and fix ownership and permissions:
# create the folder
sudo mkidr -p /mnt/flash-storage
# /mnt/flash-storage is owned by root, change to your user:group
sudo chown -R user:group /mnt/flash-storage
# allow all members of group to rw
sudo chmod -R 775 /mnt/flash-storage
Mount the share:
sudo mount -t nfs nfs-server-ip:/mnt/flash-storage /mnt/fash-storage
Verify you can see the mounts:
ls /mnt/flash-storage
Making the mounts permanent and available at boot:
Eddit fstab
sudo nano /etc/fstab
## fast flash-storage
nfs-server-ip:/mnt/flash-storage /mnt/flash-storage nfs defaults,_netdev,nofail 0 0
Note: _netdev tells the system to wait for the network to be available before mounting the shares, nofail allows the system to boot even if mounting the share fails.
Manually mount the shares:
sudo mount -a
Reboot the machine:
sudo reboot
Verify you can see the mounts:
ls /mnt/flash-storage
Troubleshooting for for Debian 13 Users:
Debian Trixie has an issue mounting nfs shares at boot.
Trixie uses ifupdown as the default network manager.
If shares are not mounting at boot:
- Install NetworkManager:
sudo apt update && sudo apt install network-manager -y
- Enable NetworkManager-wait-online service:
sudo systemctl enable NetworkManager-wait-online.service
- Reboot
- Verify you can see the mounts:
ls /mnt/flash-storage