{"id":2985,"date":"2025-09-21T21:07:54","date_gmt":"2022-12-08T16:20:22","guid":{"rendered":""},"modified":"2025-02-02T00:46:19","modified_gmt":"2025-02-01T23:46:19","slug":"how-to-install-nfs-server-and-client-on-ubuntu-22-04","status":"publish","type":"post","link":"https:\/\/netcloud24.com\/knowledgebase\/how-to-install-nfs-server-and-client-on-ubuntu-22-04\/","title":{"rendered":"Linux VPS &#038; VPS Windows Setup Guide | NetCloud24 NFS Server and Client on Ubuntu 22.04"},"content":{"rendered":"<p>\u00a0<\/p>\n<\/p>\n<header>\n<h1>\u00a0<\/h1>\n<\/header>\n<article>\n<p>Network File System (NFS) is a protocol that allows you to share files and directories between Linux systems over a network. It provides a centralized way to manage and access files. This guide will show you how to install and configure an NFS server and client on Ubuntu 22.04. Whether you are setting up NFS on a local network or on a , this tutorial will help you get started.<\/p>\n<section>\n<h2>Step 1: Update Your System<\/h2>\n<p>Before installing NFS, ensure that your system is up to date. Run the following commands to update your package list and upgrade the installed packages:<\/p>\n<pre><code>sudo apt update &amp;&amp; sudo apt upgrade -y<\/code><\/pre>\n<p>Keeping your system updated is essential for stability and security, especially when using <a href=\"https:\/\/ie.netcloud24.com\">VPS Windows VPS Servers<\/a> for hosting your NFS server.<\/p>\n<\/section>\n<section>\n<h2>Step 2: Install NFS Server<\/h2>\n<p>To set up an NFS server, you need to install the <code>nfs-kernel-server<\/code> package. Run the following command on the server machine:<\/p>\n<pre><code>sudo apt install nfs-kernel-server -y<\/code><\/pre>\n<p>Once installed, start and enable the NFS service so that it starts automatically at boot:<\/p>\n<pre><code>sudo systemctl start nfs-kernel-server\r\nsudo systemctl enable nfs-kernel-server<\/code><\/pre>\n<\/section>\n<section>\n<h2>Step 3: Configure NFS Exports<\/h2>\n<p>The next step is to define which directories the NFS server will share. You do this by editing the <code>\/etc\/exports<\/code> file. For example, to share the <code>\/srv\/nfs<\/code> directory with a specific client or network, you can add the following line to the file:<\/p>\n<pre><code>sudo nano \/etc\/exports<\/code><\/pre>\n<pre><code>\/srv\/nfs 192.168.1.0\/24(rw,sync,no_subtree_check)<\/code><\/pre>\n<p>This configuration allows read\/write access to the <code>\/srv\/nfs<\/code> directory for all clients in the 192.168.1.0\/24 subnet. You can replace the IP address range with the appropriate one for your network.<\/p>\n<p>After modifying the file, export the shared directories:<\/p>\n<pre><code>sudo exportfs -a<\/code><\/pre>\n<p>You should also restart the NFS server to apply the changes:<\/p>\n<pre><code>sudo systemctl restart nfs-kernel-server<\/code><\/pre>\n<\/section>\n<section>\n<h2>Step 4: Configure Firewall for NFS<\/h2>\n<p>If you are using a firewall on your server, you will need to allow NFS traffic. Use the following command to allow NFS through the firewall:<\/p>\n<pre><code>sudo ufw allow from 192.168.1.0\/24 to any port nfs<\/code><\/pre>\n<p>Replace <code>192.168.1.0\/24<\/code> with the appropriate subnet or IP address range of your clients.<\/p>\n<p>Reload the firewall to apply the changes:<\/p>\n<pre><code>sudo ufw reload<\/code><\/pre>\n<\/section>\n<section>\n<h2>Step 5: Install NFS Client<\/h2>\n<p>On the client machine(s), you need to install the <code>nfs-common<\/code> package to enable NFS functionality:<\/p>\n<pre><code>sudo apt install nfs-common -y<\/code><\/pre>\n<\/section>\n<section>\n<h2>Step 6: Mount NFS Share on Client<\/h2>\n<p>To mount the shared directory from the NFS server on the client machine, use the following command:<\/p>\n<pre><code>sudo mount 192.168.1.100:\/srv\/nfs \/mnt<\/code><\/pre>\n<p>Replace <code>192.168.1.100<\/code> with the IP address of your NFS server, and <code>\/mnt<\/code> with the directory where you want to mount the NFS share on the client.<\/p>\n<p>To make the mount permanent, add the following line to the <code>\/etc\/fstab<\/code> file:<\/p>\n<pre><code>192.168.1.100:\/srv\/nfs \/mnt nfs defaults 0 0<\/code><\/pre>\n<\/section>\n<section>\n<h2>Step 7: Verify NFS Share<\/h2>\n<p>You can verify the NFS mount on the client by using the <code>df -h<\/code> command to check if the shared directory is listed:<\/p>\n<pre><code>df -h<\/code><\/pre>\n<p>This command will display the mounted file systems, and you should see the NFS share in the output.<\/p>\n<\/section>\n<footer>\n<p>You have successfully installed and configured NFS server and client on Ubuntu 22.04. This setup allows you to share files and directories across a network efficiently. For scalable and high-performance hosting solutions, consider using . They offer a range of hosting services, including <strong>windows virtual private servers<\/strong>, <strong>vps windows hosting<\/strong>, and <strong>windows virtual dedicated server hosting<\/strong>. Whether you&#8217;re looking for <strong>windows vps italy<\/strong> or <strong>uk vps windows<\/strong>, their hosting options provide the performance needed to run your NFS setup.<\/p>\n<\/footer>\n<\/article>\n<div class=\"post-author-box\" style=\"border-top:1px solid #ddd;margin-top:20px;padding-top:15px;\">\n<p><strong>Author:<\/strong> \u0141ukasz Bodziony<\/p>\n<p><strong>Website:<\/strong> <a href=\"https:\/\/ca.netcloud24.com\" target=\"_blank\" rel=\"dofollow\">Windows VPS<\/a><\/p>\n<p><em>\u0141ukasz Bodziony is the CEO and founder of <a href=\"https:\/\/netcloud24.com\" target=\"_blank\" rel=\"dofollow\">NETCLOUD24<\/a>, a global VPS hosting brand proudly originating from Poland. With extensive experience in cloud computing, virtualization, and server management, he delivers high-performance <strong>Windows VPS<\/strong> and <strong>Remote Desktop Services (RDS)<\/strong> solutions to clients across Europe, North America, and beyond.<\/em><\/p>\n<p><em>His expertise covers a wide range of technologies, including <strong>Microsoft Azure<\/strong>, <strong>Proxmox VE<\/strong>, <strong>Amazon Web Services (AWS)<\/strong>, and numerous other virtualization and cloud platforms.<\/em><\/p>\n<p><em>Beyond running his hosting business, \u0141ukasz also provides <strong>professional paid server configuration and optimization services<\/strong> for companies and individuals. Outside of work, he is dedicated to caring for his children and building a secure future for them.<\/em><\/p>\n<p><em>If you are interested in working with him or need expert assistance with your hosting, cloud environment, or server setup, feel free to reach out via <a href=\"https:\/\/ca.netcloud24.com\" target=\"_blank\" rel=\"dofollow\">Windows VPS<\/a>.<\/em><\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0 \u00a0 Network File System (NFS) is a protocol that allows you to share files and directories between Linux systems over a network. It provides a centralized way\u2026<\/p>\n","protected":false},"author":1,"featured_media":3421,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","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}},"categories":[],"tags":[14,12,11,23,20,21,22,17,7,8,6,10,18,19,15,24,16,5,13,9],"class_list":["post-2985","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","tag-cheapvps","tag-cloudvps","tag-hostingvps","tag-rds","tag-rdscal","tag-remotedesktop","tag-remotedesktopvps","tag-servervps","tag-ukvps","tag-virtualserver","tag-vpshosting","tag-vpsserver","tag-vpssolutions","tag-vpswindows","tag-vpswithwindows","tag-windowsrds","tag-windowsserver","tag-windowsvps","tag-windowsvpshosting","tag-windowsvpsuk"],"jetpack_publicize_connections":[],"_links":{"self":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/2985","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=2985"}],"version-history":[{"count":0,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/2985\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/media\/3421"}],"wp:attachment":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/media?parent=2985"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=2985"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=2985"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}