How to install an NFS client on Ubuntu

Installing the NFS client on Ubuntu gives a host the helper commands it needs to discover and mount exports from an NFS server. The supported package-manager path is the distribution nfs-common package, which keeps mount.nfs, showmount, identity mapping, and Kerberos-capable client components aligned with Ubuntu updates.

The package does not turn the Ubuntu machine into an NFS server. It installs the user-space client tools used by mount, supporting files such as /etc/nfs.conf and /etc/idmapd.conf, and service units that are used when a mount requires client-side daemons.

The install is complete when apt reports nfs-common installed, mount.nfs is available, and a known server export can be queried or mounted through the network. The smoke-test commands use files.example.net:/srv/nfs/projects; replace that with an export already allowed for the client.

Steps to install an NFS client on Ubuntu:

  1. Open a terminal with sudo privileges.
  2. Refresh the package index.
    $ sudo apt update
  3. Install the NFS client package.
    $ sudo apt install --assume-yes nfs-common

    The nfs-common package installs client-side utilities such as mount.nfs and showmount. Server-side exports still require nfs-kernel-server on the host that shares the directory.

  4. Confirm the package is installed.
    $ dpkg-query -W nfs-common
    nfs-common	1:2.8.5-1ubuntu1

    The exact package version can differ between Ubuntu releases and update pockets.

  5. Confirm the NFS mount helper is available.
    $ mount.nfs --version
    mount.nfs: (linux nfs-utils 2.8.5)
  6. Query a known NFS server if one is already available.
    $ showmount --exports files.example.net
    Export list for files.example.net:
    /srv/nfs/projects 192.0.2.0/24

    Some NFSv4-only servers do not expose the older mount discovery service used by showmount. If the export path is known, test the mount directly instead.

  7. Create an empty local mount point for a manual smoke test.
    $ sudo mkdir --parents /mnt/projects

    Files already inside the mount point become hidden while the NFS filesystem is mounted there.

  8. Mount the known export.
    $ sudo mount -t nfs files.example.net:/srv/nfs/projects /mnt/projects
  9. Confirm the client mounted the export.
    $ findmnt /mnt/projects
    TARGET        SOURCE                               FSTYPE OPTIONS
    /mnt/projects files.example.net:/srv/nfs/projects nfs4   rw,relatime,vers=4.2,##### snipped #####
  10. Unmount the temporary test mount.
    $ sudo umount /mnt/projects