An Ubuntu host cannot serve NFS exports until the server package, kernel daemon, and systemd unit are present. Installing the packaged server path gives the host rpc.nfsd, exportfs, /etc/exports, and the service unit that later exports use when clients mount shared directories.

Current Ubuntu Server releases install the server through the distribution nfs-kernel-server package. The package also pulls in the common client utilities and rpcbind support, but it does not decide which directory to share, which clients may mount it, or which NFS protocol versions and security modes should be allowed.

The base install is complete when APT reports nfs-kernel-server installed, rpc.nfsd and exportfs are available, and systemd can start nfs-server.service on the host. On current packages, nfs-kernel-server.service is an alias for nfs-server.service; exports, firewall rules, Kerberos, and NFSv4-only policy remain separate follow-up tasks.

Steps to install an NFS server on Ubuntu:

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

    The nfs-kernel-server package installs the server-side pieces. Client-only hosts use nfs-common instead.

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

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

  5. Confirm the kernel server daemon is available.
    $ command -v rpc.nfsd
    /usr/sbin/rpc.nfsd

    rpc.nfsd serves client requests through the Linux kernel NFS server. Minimal containers can prove the file exists, but a real systemd host is needed to start the service.

  6. Enable the NFS server at boot and start it now.
    $ sudo systemctl enable --now nfs-server

    Ubuntu also accepts nfs-kernel-server.service because it points to nfs-server.service on current packages.

  7. Confirm the NFS server unit is active.
    $ sudo systemctl is-active nfs-server
    active

    If this command does not return active, inspect sudo journalctl -u nfs-server before adding exports or opening firewall rules.

  8. Confirm the export management command is available.
    $ command -v exportfs
    /usr/sbin/exportfs
  9. Check the active export table before adding shares.
    $ sudo exportfs -v

    No output is expected on a newly installed server with no entries in /etc/exports. After adding an export, this command should show the path, client selector, and active options.

  10. Apply the firewall rule after choosing the export and protocol policy.

    NFSv4-only servers usually need inbound TCP port 2049. Servers that must support NFSv3 also need rpcbind and mountd access, and may need fixed RPC ports before firewall rules are useful.