Call Us! 1-800-383-5193
Call Us! 1-800-383-5193
Call Us! 1-800-383-5193

Need Help?

Emergency Response Time custom

Our experts have had an average response time of 11.06 minutes in March 2021 to fix urgent issues.

We will keep your servers stable, secure and fast at all times for one fixed price.

Install and Configure NFS Server on RHEL/CentOS 8

by | Jan 14, 2021

Install and Configure NFS Server on RHEL 8/CentOS 8  with few quick and easy steps.

At Bobcares, we often get requests from our customers to install  NFS in their server as a part of Server Management Services.

Today let’s see how our Support Techs implement this for our customers in an easy way.

How to Install and Configure NFS Server on RHEL 8/CentOS 8?

Network File System(NFS) allows client systems to access files that are stored on a remote shared server over a network and lets to make use of those file systems.

NFS is a client-and-server file system(FS).  We can share files with NFS easily between multiple systems on the same network.

Here we will setup NFSv4.2 on our RHEL/CentOS system.

Install and Configure NFS Server on RHEL

Steps to Install and Configure NFS Server on RHEL

We will see the steps that our Support Techs follow to install and configure NFS.

1. Updating server and setting hostname

We can use the following commands:

$ sudo yum -y update
$ sudo hostnamectl set-hostname --staticM</code?
2. Installing NFS Server on CentOS 8/RHEL 8

First, we can install the NFS server packages on RHEL/CentOS 8 system.

$ sudo yum -y install nfs-utils

Then start and enable nfs-server service.

$ sudo systemctl enable --now nfs-server rpcbind

3. Exporting NFS Shares on RHEL 8/CentOS 8

For configuring exports on an NFS server there are two ways:

1. Manually editing the /etc/exports configuration file
2. Using the exportfs utility via command line

Syntax rules for /etc/exports configuration file are given below:

1. Blank lines are ignored.
2. Start a line with the hash (#) to add a comment.
3. With backslash (\) wee can wrap long lines.
4. Each exported file system should be on its own individual line.
5. Use space character if any lists of authorized hosts have to be mentioned after an exported file system
6. Options for each of the hosts should be placed in parentheses directly after the host identifier, without any spaces separating the host and the first parenthesis.
The steps to follow are given below:

1. We will take a secondary disk with a capacity of 20 GB. And partition this disk to create a file system on it to use as an NFS share.

$ lsblk | grep sdb
sdb 8:16 0 20G 0 disk

2. Give the following commands to create partition and file system

$ sudo parted -s -a optimal -- /dev/sdb mklabel gpt
$ sudo parted -s -a optimal -- /dev/sdb mkpart primary 0% 100%
$ sudo parted -s -- /dev/sdb align-check optimal 1
$ sudo mkfs.xfs /dev/sdb1

3. After that, we will mount this to  /data directory.

$ sudo mkdir /data
$ echo "/dev/sdb1 /data xfs defaults 0 0" | sudo tee -a /etc/fstab
$ sudo mount -a

We can check if it’s mounted properly with the following command.

$ df -hT | grep /data
/dev/sdb1 xfs 20G 176M 20G 1% /data

Next, we will create a directory on /data/nfshare

$ sudo mkdir /data/nfshare

Now we need to modify /etc/exports to configure NFS share.

The structure is:

export host(options)

Next we will use the exportfs utility to selectively export directories without restarting the NFS service.

$ sudo exportfs -rav

Finally, we have to allow NFS service in  firewalld.

$ sudo firewall-cmd --add-service=nfs --permanent
$ sudo firewall-cmd --add-service={nfs3,mountd,rpc-bind} --permanent
$ sudo firewall-cmd --reload

4. Mounting NFS Shares on Client Machines

We can mount NFS shares on a client system after the above steps. The client could be a remote system, a Virtual Machine on the same server, or on the same server itself.

[Need assistance? We are here for you!]


To conclude we saw how to Install and Configure NFS Server on RHEL along with the steps that our Support Engineers use.



Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.


var google_conversion_label = "owonCMyG5nEQ0aD71QM";


Submit a Comment

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

server management

Spend time on your business, not on your servers.


Or click here to learn more.

server management

Spend time on your business, not on your servers.


Or click here to learn more.



Privacy Preference Center


Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]


Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid


Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie


These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.