Mounting a remote folder in local network with nfs is quite simple and the topic is covered in many sources before but this formula worked for me. This example is for Debian server and clients. All steps are done as root.
Setting up the server
1. Install packages for nfs server:
# apt-get install nfs-kernel-server nfs-common portmap
2. Edit exports file:
# nano /etc/exports
3. Add wanted clients:
/path/to/shared/folder client1-ip(rw,sync)
/path/to/shared/folder client2-ip(rw,sync)
Note. No space between client-ip and (permissions).
3. Load new settings and restart related services:
# exportfs -a
# /etc/init.d/portmap restart
# /etc/init.d/nfs-kernel-server restart
# /etc/init.d/nfs-common restart
Setting up a client
1. Install nfs support for a client:
# apt-get install nfs-common portmap
2. Test mounting with:
# mount server-ip:/path/to/shared/folder /path/to/local/folder
3. If that worked you can add it to fstab. Open fstab for editing:
# nano /etc/fstab
4. Add the nfs mount :
server-ip:/path/to/shader/folder /path/to/local/folder nfs rsize=8192 0 0
That’s it. Now the remote folder is automatically mounted every time the client is booted.