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!