How to Set Up a Local NFS Share for Windows, macOS & Linux
Published on December 22, 2025
đŻ QuickâStart: A Local NFS Share That Everyone Can Use
In this post weâll walk through a âtechnicalâ path for creating a networkâshared folder that all of your devices can see.
- Server OS â Debianâbased Linux (Ubuntu, Mint, etc.)
- Clients â Windows 10/11, macOS 13+, any modern Linux distro
Why NFS?
Fast, stateless, and natively supported on Unixâlike systems.
Weâll keep the setup minimal, but you can expand it with ACLs, encryption, or move to SMB/CIFS later â weâll touch on that too.
đ Prerequisites
| Item | How to Check |
|---|---|
| Root (or sudo) access on the server | sudo -v |
| Internet connectivity for package installs | ping -c 3 google.com |
| Firewall open on ports 2049, 111, 20048 (optional, see below) | sudo ufw status |
| NFS client enabled on Windows (see âWindows clientâ section) |
Tip â If youâre using a preâbuilt appliance (e.g., Synology, QNAP), they usually come with an NFS server baked in, but the commands below are for a cleanâslate Linux box.
đĽď¸ Server Setup â Debian/Ubuntu
Update & install NFS kernel server
sudo apt update sudo apt install -y nfs-kernel-serverCreate the export directory & set permissions
sudo mkdir -p /srv/nfs/share sudo chown -R nobody:nogroup /srv/nfs/share # NFS anon user sudo chmod 777 /srv/nfs/share # open to everyone (change later)Configure exports
Open
/etc/exportsand add:/srv/nfs/share *(rw,sync,no_subtree_check,no_root_squash)rwâ read/writesyncâ write synchronouslyno_subtree_checkâ ignore subtree changesno_root_squashâ allow root access (use with caution)
Security Note â If you want stricter access, replace
*with specific IP ranges and useroot_squash+fsid=for NFSv4.Export the shares
sudo exportfs -raRestart the service & enable at boot
sudo systemctl restart nfs-kernel-server sudo systemctl enable nfs-kernel-server(Optional) Open firewall
sudo ufw allow from any to any port 2049 proto tcp sudo ufw allow from any to any port 111 proto tcp # rpcbind sudo ufw allow from any to any port 20048 proto tcp # NFSv4 portmapper sudo ufw reload
đ§âđť Client Setup
1ď¸âŁ macOS
# Create mount point
sudo mkdir -p /Volumes/share
# Mount
sudo mount -t nfs -o nolock <SERVER_IP>:/srv/nfs/share /Volumes/share
Add to /etc/fstab for autoâmount at boot:
<SERVER_IP>:/srv/nfs/share /Volumes/share nfs nolock,_netdev,auto 0 0
Tip â Use
autofsfor dynamic mounts if you want to unmount when idle.
2ď¸âŁ Linux (any distro)
# Install client packages
sudo apt install -y nfs-common
# Create mount point
sudo mkdir -p /mnt/share
# Mount
sudo mount -t nfs -o nolock <SERVER_IP>:/srv/nfs/share /mnt/share
Add to /etc/fstab:
<SERVER_IP>:/srv/nfs/share /mnt/share nfs nolock,_netdev,auto 0 0
3ď¸âŁ Windows 10/11
Windows natively supports SMB, but you can also mount NFS shares:
Enable NFS Client
Open Control Panel â Programs â Turn Windows features on or off â Check âServices for NFSâ â OK.Map network drive (cmd)
net use X: \\<SERVER_IP>\srv\nfs\shareIf you see âThe network name cannot be foundâ, doubleâcheck that the serverâs firewall allows port 2049.
Mount via PowerShell (recommended for modern syntax)
New-Item -Path "X:" -ItemType Directory New-Item -Path "X:" -ItemType Directory New-Item -Path "X:" -ItemType DirectoryTroubleshooting â Windows NFS client is a bit quirky with NFSv4. If you run into âAccess is deniedâ, try disabling
root_squashon the server side or usinganonexport instead.
đ Optional: Harden the Share
| Feature | How to enable |
|---|---|
| NFSv4 only | /etc/nfs.conf â fsid = 0 and no no_root_squash |
| Export ACLs | setfacl -m g:staff:rwx /srv/nfs/share |
| Firewall only for your LAN | sudo ufw allow from 192.168.1.0/24 to any port 2049 |
| Kerberos authentication | Install krb5-config + configure /etc/krb5.conf (advanced) |
đ¨ Troubleshooting Checklist
| Symptom | Check | Command |
|---|---|---|
| Clients cannot see the share | Server listening? | `sudo ss -tulpn |
| Mount fails with âPermission deniedâ | Export options? | cat /etc/exports |
| No traffic on port 2049 | Firewall? | sudo ufw status |
| Clients see âno such file or directoryâ | Path mismatch? | ls -l /srv/nfs/share |
| NFSv4 clients get ânfs: server denied mount requestâ | root_squash or ACLs? | exportfs -v |
đ Whatâs Next?
- SMB/CIFS: If you need a âdropâinâ Windows share, swap
nfs-kernel-serverforsambaand edit/etc/samba/smb.conf. - SSHFS: A quick way to mount over SSH without configuring NFS at all.
sudo apt install -y sshfs sshfs user@server:/srv/nfs/share ~/sshfs_share - Autossh / VPN: For remote access, tunnel your NFS over SSH or a VPN.
đ WrapâUp
Youâve now got a fully functional NFS share that:
- Works on every major OS
- Is simple enough to be repeated in a future homelab
- Is a solid foundation for more advanced features
Happy hacking, and stay tuned for the EasyâButton version of this tutorial coming next!
Feel free to fork the markdown template, tweak the commands for your distro, and drop comments or pull requests. Happy building!