NFS on Ubuntu

A very condensed post about setting up an example NFS server and client All actions as root.

Configure the server

sudo su
apt update
apt install nfs-kernel-server
systemctl start nfs-kernel-server.service
mkdir -p /data/acme
nano /etc/exports 

And add this to file exports:

/data/acme *(rw,sync,no_subtree_check)


exportfs -a
ufw status
ufw allow from to any port nfs

“ufw status numbered” list rules. To remove a rule – say number 5 – do “ufw delete 5”.

Configure the client

sudo su
apt update
apt install nfs-common
mkdir -p /data/nfs/acme
nano /etc/fstab

In fstab, add:  /data/nfs/acme  nfs  defaults  0 0

Additional information

NFS can be hard to configure. Links below and specific searches can help.

One thing is important, communication between guest and host is based on user and group information and it is important to understand that uid and gid play a role here, they should be the same on host and guest. You have to retrieve them from a guest station (“id -u UserName” and “id -g UserName” returning for example 1003 and 1005) and a line in /etc/exports on the server can look like:



Leave a Reply

Your email address will not be published. Required fields are marked *