Step 1: Configure the NFS Server
sudo apt update
sudo apt install nfs-kernel-server -y
sudo mkdir -p /nfs
sudo chown nobody:nogroup /nfs
echo "/srv/nfs/share *(rw,sync,no_subtree_check,no_root_squash)" >> /etc/exports
sudo exportfs -arv
Step 2: Mount the NFS Share on the Client
sudo apt update
sudo apt install nfs-common -y
sudo mkdir -p /mnt/nfs/share
sudo mount -t nfs <nfs-server-ip>:/srv/nfs/share /mnt/nfs/share
Step 3: Permanent Mount (Optional)
echo "<nfs-server-ip>:/srv/nfs/share /mnt/nfs/share nfs defaults 0 0" >> /etc/fstab
sudo mount -a