Use the apt-get or yum command to install NFS
yum install nfs-utils
If using iptables, allow NFS.
iptables -I INPUT -p 2049 -j ACCEPT iptables-save > /etc/sysconfig/iptables
If using Firewalld, allow NFS.
firewall-cmd --add-service=nfs --permanent firewall-cmd --reload
Let's say you want to share /var/myShare. Edit the /etc/exports file, and add the following. In this example, only a single client is allowed to mount the share, client1.example.com. * can be used to allow any client to mount the share.
Export the new addition.
The ps command can be used to determine if your system is using init or systemd. If PID 1 is init, then you will use the service command. If PID 1 is systemd, then you will use the systemctl command.
If your system is using systemd, use the systemctl command to start and enable nfs.
systemctl enable nfs systemctl start nfs systemctl status nfs
chkconfig nfs on service nfs start service nfs status
You can now access this share from a different computer in our LAN.