{"id":1174,"date":"2017-02-28T23:09:06","date_gmt":"2017-02-28T17:39:06","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=1174"},"modified":"2026-09-08T09:50:32","modified_gmt":"2026-09-08T04:20:32","slug":"setup-nfs-server-configure-nfs-mount-point-ubuntu","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/setup-nfs-server-configure-nfs-mount-point-ubuntu\/","title":{"rendered":"Set up the NFS server and configure an NFS mount point on Ubuntu"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">NFS (Network File System) allows files and directories on one server to be accessed remotely by another server over a network.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this guide, we will configure an <strong>NFS server on Ubuntu<\/strong> and mount the shared NFS directory on a <strong>client Ubuntu server<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before starting, make sure:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Two Ubuntu servers are available.<\/li>\n\n\n\n<li>One server will act as the <strong>NFS server<\/strong>.<\/li>\n\n\n\n<li>The second server will act as the <strong>NFS client<\/strong>.<\/li>\n\n\n\n<li>You have root or sudo access on both servers.<\/li>\n\n\n\n<li>The client server can communicate with the NFS server over the network.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Implementation<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Install NFS Server<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">On the server that will provide the shared directory, install the NFS server package:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">apt-get install nfs-kernel-server<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Create the NFS Share Directory<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Create a directory that will be shared with the client:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">mkdir \/nfsshare<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Change the ownership and group of the directory:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">chown nobody:nogroup \/nfsshare<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Configure NFS Exports<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Open the <code>\/etc\/exports<\/code> file:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">vi \/etc\/exports<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Add the following line:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/nfsshare 172.0.0.0\/8(rw,sync,no_root_squash,no_subtree_check)<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The options used above are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>172.0.0.0\/8<\/strong> \u2013 Specifies the client IP address or IP range allowed to access the NFS share.<\/li>\n\n\n\n<li><strong>rw<\/strong> \u2013 Allows the client to read and write files.<\/li>\n\n\n\n<li><strong>sync<\/strong> \u2013 Ensures changes are written before the request is completed.<\/li>\n\n\n\n<li><strong>no_root_squash<\/strong> \u2013 Allows the client-side root user to retain root privileges on the exported filesystem.<\/li>\n\n\n\n<li><strong>no_subtree_check<\/strong> \u2013 Disables subtree checking for the exported directory.<\/li>\n<\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">For better security, use the specific client IP address or a restricted network range instead of allowing a broad range.<\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">Step 4: Restart the NFS Service<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Restart the NFS service to apply the configuration:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">systemctl restart nfs-kernel-server<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Client Side NFS Configuration<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Step 5: Install NFS Client Packages<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">On the Ubuntu client server, install <code>nfs-common<\/code>:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">apt-get install nfs-common<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 6: Create the Mount Point<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Create a directory where the remote NFS share will be mounted:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">mkdir \/nfs<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 7: Mount the NFS Share<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Mount the NFS directory using the NFS server&#8217;s IP address:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">mount -t nfs xx.xx.xx.xx:\/nfsshare \/nfs<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Here, <code>xx.xx.xx.xx<\/code> represents the IP address of the NFS server.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 8: Configure Permanent NFS Mount<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To automatically mount the NFS share after a system reboot, add an entry to <code>\/etc\/fstab<\/code>:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">vi \/etc\/fstab<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Add:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">xx.xx.xx.xx:\/       \/nfs    nfs auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Testing<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Verify the Mounted NFS Share<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Run the following command:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">df -h<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The output should show the NFS filesystem mounted on <code>\/nfs<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Unmount the NFS Share<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To unmount the NFS directory:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">umount \/nfs<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Test the <code>\/etc\/fstab<\/code> Configuration<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Since the NFS mount has been added to <code>\/etc\/fstab<\/code>, use the following command to test the configuration:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">mount -a<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This will attempt to mount the entries configured in <code>\/etc\/fstab<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">NFS provides a simple way to share files and directories between Linux servers. In this setup, one Ubuntu server acts as the NFS server and exports <code>\/nfsshare<\/code>, while another Ubuntu server mounts that share under <code>\/nfs<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Configuring the share in <code>\/etc\/fstab<\/code> also allows the NFS mount to be restored automatically after a reboot.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">FAQs<\/h2>\n\n\n\n<h4 class=\"wp-block-heading\">1. What is NFS used for?<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">NFS allows a client system to access files and directories stored on a remote Linux server as though they were part of its local filesystem.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">2. Which package is required on the NFS server?<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Install the following package on the NFS server:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">apt-get install nfs-kernel-server<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">3. Which package is required on the NFS client?<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Install:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">apt-get install nfs-common<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">4. How can I make an NFS mount permanent?<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Add the NFS share to <code>\/etc\/fstab<\/code> and run:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">mount -a<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">5. How can I verify that the NFS share is mounted?<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Use:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">df -h<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The mounted NFS filesystem should appear in the output.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Related Articles<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">How to Remove, Install Oracle Java JDK in Ubuntu 16.04<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Learn how to manage Oracle Java JDK installation and removal on Ubuntu 16.04.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-pheonix-solutions wp-block-embed-pheonix-solutions\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"lPEd25R5RT\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/how-to-remove-install-oracle-java-jdk-in-ubuntu-16-0-4\/\">How to remove &amp; install oracle java [Jdk] in ubuntu 16.0.4<\/a><\/blockquote><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"\u201cHow to remove &amp; install oracle java [Jdk] in ubuntu 16.0.4\u201d \u2014 Pheonix Solutions\" src=\"https:\/\/pheonixsolutions.com\/blog\/how-to-remove-install-oracle-java-jdk-in-ubuntu-16-0-4\/embed\/#?secret=G2BKCaJp07#?secret=lPEd25R5RT\" data-secret=\"lPEd25R5RT\" width=\"500\" height=\"282\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">How to Install Node.js in Ubuntu 16.04<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Learn how to install Node.js on an Ubuntu 16.04 server and configure the required packages.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-pheonix-solutions wp-block-embed-pheonix-solutions\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"Bm30uzg2MX\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/how-to-install-node-js-in-ubuntu-16-0-4\/\">How to Install node js in Ubuntu -16.0.4<\/a><\/blockquote><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"\u201cHow to Install node js in Ubuntu -16.0.4\u201d \u2014 Pheonix Solutions\" src=\"https:\/\/pheonixsolutions.com\/blog\/how-to-install-node-js-in-ubuntu-16-0-4\/embed\/#?secret=mLuMEi0KpH#?secret=Bm30uzg2MX\" data-secret=\"Bm30uzg2MX\" width=\"500\" height=\"282\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Talk to our experts<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Looking for the right technology solution for your business? Our team of experts can help you with development, cloud, DevOps, design, and a wide range of other technology needs. Get in touch with our team&nbsp;<a href=\"https:\/\/pheonixsolutions.com\/contact\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction NFS (Network File System) allows files and directories on one server to be accessed remotely by another server over [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1022],"tags":[289,274],"class_list":["post-1174","post","type-post","status-publish","format-standard","hentry","category-web-architecture","tag-nfs","tag-ubuntu","psol-cat-web-architecture"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-iW","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1174","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=1174"}],"version-history":[{"count":1,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1174\/revisions"}],"predecessor-version":[{"id":11505,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1174\/revisions\/11505"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=1174"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=1174"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=1174"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}