Ubuntu 16.04: Install nfs-kernel-server and run NFS server

This article will describe installing nfs-kernel-server and running NFS server.


1 System environment

IP Address of NFS server is

Export directory to network.

2 Install nfs-kernel-server

Install nfs-kernel-server with apt.

$ sudo apt-get install -y nfs-kernel-server

3 Export directory

Export /opt/nfs to network.

$ sudo mkdir -p /opt/nfs
$ sudo su -c "echo '/opt/nfs,sync,no_subtree_check,no_root_squash)'  \
>> /etc/exports" $ sudo exportfs -ra

4 Run nfs-kernel-server

Run nfs-kernel-server with systemd.

$ sudo systemctl enable nfs-kernel-server.service
$ sudo systemctl start nfs-kernel-server.service

5 Execution result

Access from network machine to NFS server. If nfs mount on Ubuntu 16.04, nfs-common package is needed.

$ sudo apt-get install -y nfs-common
$ sudo mount -t nfs /mnt