[vc_row][vc_column width="3/4"][vc_column_text]In this article, we will learn how to install NFS on Ubuntu 16.04Network File System (NFS) protocol and a filesystem which allows you to access the shared folders from the┬áremote system or server and also allows you to mount as a remote directory on the servers. This allows you┬áto share the storage space between different clients in different locations. NFS has been always the easiest way to access the remote storages over a network.

<strong>NFS┬á</strong>( Network file systems ) is used to share files with other computers over the network. It is mainly used for centralized home folders.

To accomplish this demo, we need two systems which Ubuntu installed and user with sudo permissions with a private network.[/vc_column_text][vc_custom_heading stm_title_font_weight="500" text="Setup NFS server on ubuntu 14.04" font_container="tag:h3|text_align:left" google_fonts="font_family:Ubuntu%3A300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic|font_style:400%20regular%3A400%3Anormal"][vc_tta_accordion][vc_tta_section title="Installing the Packages on Server" tab_id="1522223448415-161a1f70-8c52"][vc_column_text css=".vc_custom_1522225582156{padding-top: 10px !important;padding-right: 10px !important;padding-bottom: 10px !important;padding-left: 10px !important;background-color: #000000 !important;}"]
<pre><span style="color: #000000;">$ sudo apt update
$ sudo apt install nfs-kernel-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
┬á keyutils libnfsidmap2 libpython-stdlib libpython2.7-minimal
┬á libpython2.7-stdlib libtirpc1 nfs-common python python-minimal python2.7
┬á python2.7-minimal rpcbind
Suggested packages:
┬á watchdog python-doc python-tk python2.7-doc binutils binfmt-support
The following NEW packages will be installed:
┬á keyutils libnfsidmap2 libpython-stdlib libpython2.7-minimal
┬á libpython2.7-stdlib libtirpc1 nfs-common nfs-kernel-server python
┬á python-minimal python2.7 python2.7-minimal rpcbind
0 upgraded, 13 newly installed, 0 to remove and 98 not upgraded.
Need to get 4,375 kB of archives.
After this operation, 18.5 MB of additional disk s
Selecting previously unselected package libnfsidmap2:amd64.
(Reading database ... 56995 files and directories currently installed.)
..
ÔÇª
ÔÇª
currently installed.)
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (229-4ubuntu4) ...
Setting up libnfsidmap2:amd64 (0.25-5) ...
Setting up libpython2.7-stdlib:amd64 (2.7.12-1~16.04) ...
Setting up python2.7 (2.7.12-1~16.04) ...
Setting up libpython-stdlib:amd64 (2.7.11-1) ...
Setting up python (2.7.11-1) ...
Setting up libtirpc1:amd64 (0.2.5-1) ...
Setting up keyutils (1.5.9-8ubuntu1) ...
Setting up rpcbind (0.2.3-0.2) ...
Setting up nfs-common (1:1.2.8-9ubuntu12) ...
Creating config file /etc/idmapd.conf with new version
Progress: [ 98%] [##########################################################]
Adding system user `statd' (UID 110) ...
Adding new user `statd' (UID 110) with group `nogroup' ...
Not creating home directory `/var/lib/nfs'.
nfs-utils.service is a disabled or a static unit, not starting it.
Setting up nfs-kernel-server (1:1.2.8-9ubuntu12) ...
Creating config file /etc/exports with new version
Creating config file /etc/default/nfs-kernel-server with new version
Processing triggers for libc-bin (2.23-0ubuntu3) ...
Processing triggers for ureadahead (0.100.0-19) ...########################.]
Processing triggers for systemd (229-4ubuntu4) ...</span></pre>
[/vc_column_text][/vc_tta_section][/vc_tta_accordion][vc_tta_accordion][vc_tta_section title="Installing the Packages on Client Side" tab_id="1522225712038-777a08de-a909"][vc_column_text css=".vc_custom_1522225792488{padding-top: 10px !important;padding-right: 10px !important;padding-bottom: 10px !important;padding-left: 10px !important;background-color: #000000 !important;}"]
<pre>$ sudo apt update
$ sudo apt install nfs-common
apt install nfs-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
 watchdog
The following NEW packages will be installed:
 nfs-common
0 upgraded, 1 newly installed, 0 to remove and 98 not upgraded.
Need to get 185 kB of archives.
After this operation, 734 kB of additional disk space will be used.
Get:1 http://in.archive.ubuntu.com/ubuntu xenial/main amd64 nfs-common amd64 1:1 .2.8-9ubuntu12 [185 kB]
Fetched 185 kB in 1s (126 kB/s)
Selecting previously unselected package nfs-common.
(Reading database ... 57864 files and directories currently installed.)
Preparing to unpack .../nfs-common_1%3a1.2.8-9ubuntu12_amd64.deb ...
Unpacking nfs-common (1:1.2.8-9ubuntu12) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (229-4ubuntu4) ...
Setting up nfs-common (1:1.2.8-9ubuntu12) ...
</pre>
[/vc_column_text][/vc_tta_section][/vc_tta_accordion][vc_column_text]
<h4>Enabling and Creating the Share Directories on the Server</h4>
Here for demo┬ápurpose, we are going to share two folders to differentiate the configuration, setting, First one is with superuser permission and other with trusted users on the client system.
<h4>Exporting a General Mount</h4>
In this example, we will create a general NFS mount that with the default configuration which is difficult for a user without any permissions on the client machine they can access and this can be used to create a shared space to store the project files in the folders.[/vc_column_text][/vc_column][vc_column width="1/4"][vc_raw_html]JTNDZGl2JTIwY2xhc3MlM0QlMjJ2Y193cF9jYXRlZ29yaWVzJTIwd3BiX2NvbnRlbnRfZWxlbWVudCUyMiUzRSUzQ2FzaWRlJTIwY2xhc3MlM0QlMjJ3aWRnZXQlMjB3aWRnZXRfY2F0ZWdvcmllcyUyMiUzRSUzQ2g1JTIwY2xhc3MlM0QlMjJ3aWRnZXRfdGl0bGUlMjIlM0VPdXIlMjBQcm9kdWN0cyUzQyUyRmg1JTNFJTA5JTA5JTNDdWwlM0UlMEElMDklM0NsaSUyMGNsYXNzJTNEJTIyY2F0LWl0ZW0lMjBjYXQtaXRlbS0xNSUyMiUzRSUzQ2ElMjBocmVmJTNEJTIyaHR0cHMlM0ElMkYlMkZ0aG91Z2h0Y2VudHJpeC5jb20lMkZ3b3JrcyUyRnNob3BpZnktY29ubmVjdG9ycyUyRiUyMiUzRVNob3BpZnklMjBDb25uZWN0b3JzJTNDJTJGYSUzRSUwQSUzQyUyRmxpJTNFJTBBJTA5JTNDbGklMjBjbGFzcyUzRCUyMmNhdC1pdGVtJTIwY2F0LWl0ZW0tMTclMjIlM0UlM0NhJTIwaHJlZiUzRCUyMmh0dHBzJTNBJTJGJTJGdGhvdWdodGNlbnRyaXguY29tJTJGd29ya3MlMkZzZWFyY2gtYWRpY3RzJTJGJTIyJTNFU2Vh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