Configure and Set Up NFS Server and Client on Windows and Linux

0
(0)

An NFS server lets multiple machines access shared files over a network. NFS is commonly used for Linux servers, development environments, backup storage, web clusters, media workloads, internal file sharing, and mixed Windows/Linux infrastructure.

What Is NFS?

NFS stands for Network File System. A client machine can mount a remote directory and use it like a local folder. Several servers or workstations can then access the same files.

Common NFS Use Cases

  • Shared storage between Linux servers.
  • Development environments.
  • Backup targets.
  • Media libraries.
  • Web server clusters.
  • Mixed Windows and Linux access.

NFS Port

The main NFS port is 2049. Firewall rules must allow the required NFS traffic between clients and the server.

Install NFS Server on Linux

sudo apt update
sudo apt install nfs-kernel-server

Create a Shared Directory

sudo mkdir -p /srv/nfs/share
sudo chown nobody:nogroup /srv/nfs/share

Configure Exports

Edit /etc/exports and add a share rule:

/srv/nfs/share 192.168.1.0/24(rw,sync,no_subtree_check)

Apply the Export

sudo exportfs -a
sudo systemctl restart nfs-kernel-server

Mount NFS on a Linux Client

sudo apt install nfs-common
sudo mkdir -p /mnt/share
sudo mount server-ip:/srv/nfs/share /mnt/share

Use NFS on Windows

Windows can access NFS after the NFS client feature is enabled. You can enable it through Windows Features or PowerShell, then mount the NFS share.

NFS Security Tips

  • Restrict access by IP or subnet.
  • Use firewall rules.
  • Avoid exposing NFS to the public internet.
  • Use least privilege permissions.
  • Monitor mounted shares and access logs.
See also  How to Install Nextcloud Step by Step on a VPS in 2026

Conclusion

NFS provides shared file access across Linux and mixed infrastructure. Configure exports carefully, restrict access, open only required ports, and test client mounts before using NFS in production.

FAQs

What is an NFS server?

An NFS server shares directories over a network so client machines can mount and access them.

What port does NFS use?

NFS commonly uses port 2049.

Can Windows connect to an NFS server?

Yes, Windows can connect to NFS shares when the NFS client feature is enabled.

Continue exploring

Latest Hosting Guides

View all guides

Swipe or scroll to explore more guides

Was this guide helpful?

Rate this guide from 1 to 5 stars.

Average rating: 0 / 5. Ratings: 0

No ratings yet. Be the first to rate this guide.

Leave a Comment