Share directories between Linux hosts with NFS

8 steps · about 2 h 13 min · Intermediate

  1. Install an NFS server and client on Ubuntu (article, Ubuntu Server documentation, 12 min)

    The shortest working path from package install to a mounted share.

  2. Set up an NFS mount between two servers (tutorial, DigitalOcean Community, 30 min)

    A full two-host walkthrough including ownership and root squashing.

  3. Configure NFSv4 exports, clients and troubleshooting (article, ArchWiki, 30 min)

    Detailed server and client setup plus a long troubleshooting section.

  4. Choose export options in /etc/exports (reference, man7.org Linux man pages, 15 min)

    Defines rw, sync, root_squash and host patterns so exports stay tight.

  5. Reload and list exports with exportfs (reference, man7.org Linux man pages, 8 min)

    Lets you apply export changes without restarting the server.

  6. Pick client mount options for NFS (reference, man7.org Linux man pages, 15 min)

    Explains hard vs soft, timeouts and versions that decide failure behaviour.

  7. Mount shares on demand with autofs (article, ArchWiki, 15 min)

    Avoids boot hangs by mounting shares only when they are accessed.

  8. Check NFS traffic and errors with nfsstat (reference, man7.org Linux man pages, 8 min)

    Gives server and client counters for spotting retransmits and errors.