Setup nfs server on Amazon Ec23 min read

We need your support!!
Other Amount:
24-Hour Flash Sale. Courses from just ₹ 490.
Prabhin Prabharkaran Administrator
DevOps Engineer

He is a Technical professional. He is a person who loves to share tricks and tips on the Internet. He Posts what he does!

follow me

The Network File System (NFS) is a client/server application that lets a computer user view and optionally store and update files on a remote computer as though they were on the user’s own computer. The NFS protocol is one of several distributed file system standards for network-attached storage (NAS).

Setup NFS Server

In my case, I have a new EBS volume which is mounted to nfs server on location /backup. I need this volume to be mounted on some of the other servers.

NFS Server:
NFS client:

Step 1: Install NFS-server packages

yum install nfs-utils


Step 2: Create the shared folder and change the permissions


mkdir /backup
chmod -R 755 /backup
chown nfsnobody:nfsnobody /backup

Step 3: Create the configuration file which has share details.

vi /etc/exports


In the above case the NFS share will be accessible by, if you need your entire network to access the share then change it as given below.



You can add multiple shares in the same configuration file below is an example


Step 4: Restart the nfs-server service to make the configuration effective.


service nfs-server restart


Now you have completed the NFS-server share configuration

Setup NFS client


Step 5: Install the NFS client package

yum install nfs-utils


Step 6: Create a folder where you want to mount the NFS share, In my case I’m going to create a folder called /data

mkdir -p /data

Step 7: Mount the nfs share

mount -t nfs /data

Now execute df -h command to see the disk size with all the mount points

Filesystem            Size  Used Avail Use% Mounted on
devtmpfs              3.7G     0  3.7G   0% /dev
tmpfs                 3.7G     0  3.7G   0% /dev/shm
tmpfs                 3.7G  520K  3.7G   1% /run
tmpfs                 3.7G     0  3.7G   0% /sys/fs/cgroup
/dev/vda1             493G  286G  187G  61% /  493G  383G   85G  83% /backup
tmpfs                 756M     0  756M   0% /run/user/0


Step 8: Configure fstab

It is required to configure fstab otherwise once the system rebooted the mounted volume will get unmount. Then you need to mount it again manually. If fstab is configured whenever the system reboots the mount volume will be get mounted back automatically

vi /etc/fstab /data nfs defaults 0 0

save and apply. you can test the fstab is working by restart the client machine.



Happy learning


We need your support!!
Other Amount:
Questions Answered
Articles Written
Overall Points

Prabhin Prabharkaran

He is Technical professional. He is a person who loves to share tricks and tips on the Internet. He Posts what he does!!

You may also like...

Leave a Reply