NFS on Ubuntu

A very condensed post about setting up an NFS server and client.

# is root, $ is user. For # do sudo su

Configure the server 192.0.2.1

1
2
3
4
5
6
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:

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

Next:

1
2
3
exportfs -a
ufw status
ufw allow from 192.0.2.16 to any port nfs

Configure the client 192.0.2.16

1
2
3
4
5
sudo su
apt update
apt install nfs-common
mkdir -p /data/nfs/acme
nano /etc/fstab

In fstab, add:

1
192.0.2.1:/data/acme  /data/nfs/acme  nfs  defaults  0 0

Leave a Reply

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