All you need is:
– A Linux server running CentOS 8+
– 4GB RAM
– 20Gb hard disk.
If you need more space for data storage, use larger disks.
To quickly install an NFS server on Linux, just run the following commands.
Software:
dnf -y install mc nfs4-acl-tools nfs-utils sssd-nfs-idmap libnfsidmap
Enable NFS Service:
systemctl enable --now nfs-server.service
Check RPC:
rpcinfo -p
Create the shared directories:
mkdir -p {/registry,/shares} && \
chown -R nobody: {/registry,/shares} && \
chmod 775 {/registry,/shares}
Export the shared directories:
tee /etc/exports <<EOF
/registry *(rw,sync,no_all_squash,root_squash)
/shares *(rw,sync,no_all_squash,root_squash)
EOF
exportfs -arv && exportfs -s
Firewall and SELinux are beyond the scope of this article. So, disable them to move on more quickly.
I recommend that in production environments SELinux is always in Enforcing mode, and that the local Firewall is enabled.
Disable SELinux:
sed -i s/=enforcing/=disabled/g /etc/selinux/config
Disable local Firewall:
systemctl disable firewalld.service
Reboot and you’re done.
reboot
The nfs-server service will start automatically during boot, and will be ready for use it.
If you’re adventurous and like to try out new things, I recommend NFS Ganesha, which is a solution that runs in userspace, and delivers good performance.
Did you like the content? Check out these other interesting articles! 🔥
Do you like what you find here? With every click on a banner, you help keep this site alive and free. Your support makes all the difference so that we can continue to bring you the content you love. Thank you very much! 😊