SlideShare a Scribd company logo
1/11
April 3, 2025
How to Install NFS Server and Client on Ubuntu 24.04
greenwebpage.com/community/how-to-install-nfs-server-and-client-on-ubuntu-24-04/
Tutorials
by Karim Buzdar
April 3, 2025
NFS (Network File System) is a file system that allows file sharing over the local file
system. It is commonly used in Linux environments, especially in Ubuntu 24.04. NFS
makes file sharing easy between different machines and users. It eliminates the burden
faced by individual file servers and allows users to access shared files from a centralized
server. The use of NFS has increased dramatically in data centers, media rooms, and dev
teams.
This detailed tutorial will contain step-by-step instructions on how you can install and set
up NFS on Ubuntu 24.04.
How to Install NFS on Ubuntu 24.04
In simpler words, NFS is centralized storage for information such as text documents,
images and videos. It saves these so that multiple systems can easily access them.
Prerequisites
You will need the following to install NFS:
Two Ubuntu 24.04 Systems: One can be used as the server the other as a client.
2/11
Root or Sudo Access: You must have the correct permission to log in as root or
user sudo to make changes to the setup or settings of NFS.
Network Connectivity: Ensure same network information for both machines so that
they can communicate with one another.
Step 1: Install NFS Server on Ubuntu 24.04
The first step is to install an NFS server package on the system, which will act as the
server. To do so:
Update the Package List:
Execute the following command to update your package list:
sudo apt update
Install the NFS Kernel Server:
To install the NFS server package, execute the command shown below:
sudo apt install nfs-kernel-server
3/11
Confirm the Installation:
To confirm that NFS service is active, run the command. Now, you receive a status
response with an active running state for NFS:
sudo systemctl status nfs-kernel-server
Step 2: Configure the NFS Server
After installing the NFS server, users need to configure it to share directories:
Create a Shared Directory:
In case you need to share any directories, create a shared one in the root home and
name it for ease:
sudo mkdir -p /mnt/nfs_share
4/11
Set Directory Permissions:
Adjust the permissions of the shared directory to ensure clients can access it:
sudo chown nobody:nogroup /mnt/nfs_share
Grant the restricted level access permissions to ensure clients can access it.
sudo chmod 777 /mnt/nfs_share
Edit the Exports File:
After that, open the /etc/exports file, which contains the shared and client access
configurations:
sudo nano /etc/exports
5/11
You can replace client_ip with the specific address of the system with which you would
like to share it:
/mnt/nfs_share client_ip(rw,sync,no_subtree_check)
These are the conditions that will be active on sharing domains:
rw: read-write permission, granting the ability to write and edit the directory.
sync: Requests acknowledgment will only be given after the changes have been
successfully written to the disk.
no_subtree_check: Here, performance is improved by turning off subtree check.
To allow sharing the directory for all clients in a subnet, do the following:
/mnt/nfs_share 192.168.1.0/24(rw,sync,no_subtree_check)
6/11
Export the Shared Directory:
After the changes have been made, the next step to take is to export the shared directory:
sudo exportfs -a
Restart the NFS Server:
The next step is to restart the NFS service so that the system can make use of the new
configuration:
sudo systemctl restart nfs-kernel-server
Step 3: Allow Clients Through Firewall
For those making use of UFW, you have to allow clients through the firewalls:
sudo ufw allow from [clientIP or clientSubnetIP] to any port nfs
7/11
To confirm that this operation has been completed, type the following:
sudo ufw status
Step 4: Install NFS Client on Ubuntu 24.04
Install the NFS client package in the client machine to enable access to the shared
directory. To do so:
Update the Package List:
Do the following to update the package list:
sudo apt update
Install the NFS Client:
Install the NFS client package:
sudo apt install nfs-common
8/11
Step 5: Mount the NFS Share on the Client
After you install the NFS client, you will be able to mount the directory shared on the
server:
Create a Mount Point:
Make a directory that will hold the shared files that are accessible:
sudo mkdir -p /mnt/nfs_client_share
Mount the NFS Share:
Use this command to mount the shared directory (make sure to put server_ip where the
address of the NFS server is):
sudo mount server_ip:/mnt/nfs_share /mnt/nfs_client_share
Verify the Mount:
To check whether the NFS share has been mounted:
df -h
9/11
After executing the command, the shared directory should be present among other items.
Step 6: Automount the NFS Share (Optional)
If you want to mount the NFS share automatically at boot, add an entry in /etc/fstab.
Edit the fstab File:
Open the file using a text editor of your choice:
sudo nano /etc/fstab
Add the NFS Share:
Add this line to the file (make sure you put the NFS server’s IP address instead of
server_ip):
server_ip:/mnt/nfs_share /mnt/nfs_client_share nfs defaults 0 0
10/11
Test the Configuration:
Test the configuration by unmounting and remounting all filesystems:
sudo umount /mnt/nfs_client_share
Now, mount all filesystems listed in the /etc/fstab file, typically used during system
startup or to apply changes made to the file:
sudo mount -a
Step 7: Test the NFS Setup
Finally, check that the NFS setup works by performing the following steps:
Create a Test File on the Server:
On the server, navigate to the shared location and create the file:
sudo touch /mnt/nfs_share/testfile.txt
11/11
Verify on the Client:
On the client side, confirm the accessibility of the created file:
ls /mnt/nfs_client_share
The output shows the testfile.txt in the client side.
Some Issues and Their Solutions
Permission Denied: Check that the shared directory’s permissions are correctly set
and that the client IP is accepted in the /etc/exports file.
Mount Failure: Check that the NFS service on the server is active and that the
client can connect to the server through the network.
Firewall Blocking: Check that the server firewall is set to permit the NFS service
(ports 2049, 111, and others).
Conclusion
Installing NFS on Ubuntu 24.04 is simple. It allows for more efficient file sharing and
retrieval between systems. This guide ensures that NFS is installed and configured
adequately on the server and client sides. NFS is beneficial for data center management,
developing teams, or media production settings because it simplifies file sharing and
collaboration.

More Related Content

PDF
Network File System (NFS)
PPT
Server configuration
PDF
sharing-filesystems-using-nfs-slides.pdf
PDF
Access Network Attached Storage in RHEL - RHCSA (RH134).pdf
PPT
Solaris 10 administration 2 Configuring NFS
PPT
Chapter 05
 
PDF
Nfs
PPTX
Network file system (nfs)
Network File System (NFS)
Server configuration
sharing-filesystems-using-nfs-slides.pdf
Access Network Attached Storage in RHEL - RHCSA (RH134).pdf
Solaris 10 administration 2 Configuring NFS
Chapter 05
 
Nfs
Network file system (nfs)

Similar to How to Install NFS Server and Client on Ubuntu 2404.pdf (20)

PPS
Linux06 nfs
PPTX
Linux network file system (nfs)
PPTX
PPT
Ch18 system administration
PPT
Nf Sp4
PPT
NETWORK FILE SYSTEM
PPTX
Network File System
PDF
FUSE and beyond: bridging filesystems paper by Emmanuel Dreyfus
PDF
Documentation freenas
DOCX
Documentation free nas
PPTX
Linux System Administration - NFS Server
PPTX
NFS is an excellent way of sharing files between linux and other unix systems
PDF
Ubuntu server guide
PPT
FILE SERVER
PPT
File Sever
PPTX
HP-UX 11iv3 Ignite-UX with NFSv4 and SSH Tunnel by Dusan Baljevic
PPT
Presentation on nfs,afs,vfs
PDF
7-compiling the Linux kerne pdf type is it
PDF
Cluster management (supercomputer)
Linux06 nfs
Linux network file system (nfs)
Ch18 system administration
Nf Sp4
NETWORK FILE SYSTEM
Network File System
FUSE and beyond: bridging filesystems paper by Emmanuel Dreyfus
Documentation freenas
Documentation free nas
Linux System Administration - NFS Server
NFS is an excellent way of sharing files between linux and other unix systems
Ubuntu server guide
FILE SERVER
File Sever
HP-UX 11iv3 Ignite-UX with NFSv4 and SSH Tunnel by Dusan Baljevic
Presentation on nfs,afs,vfs
7-compiling the Linux kerne pdf type is it
Cluster management (supercomputer)
Ad

More from Green Webpage (20)

PDF
How to Upgrade Linux Mint From 21 to 22.pdf
PDF
How to Install VirtualBox on Linux Mint 22.pdf
PDF
How to Install VMware Workstation on Linux Mint 22.pdf
PDF
How to Install Google Chrome on Ubuntu 24.04.pdf
PDF
How to Install XRDP on Debian 12 Server.pdf
PDF
How to Install Apache on Debian 12 Server
PDF
How to Install OpenJDK on Debian 12 Server.pdf
PDF
How to Install Cuda on Debian 12 Server.pdf
PDF
How to Install GCC Compiler on Debian 12.pdf
PDF
How to Install UFW Firewall on Debian 12.pdf
PDF
How to Check the Kernel Version in Debian 12.pdf
PDF
How to Install and Configure MariaDB on Debian 12.pdf
PDF
How to Install Python on Debian 12 Server
PDF
How to Install phpMyAdmin on Debian 12.pdf
PDF
How to Install and Configure Webmin on Debian 12.pdf
PDF
How to Change an IP Address on Debian 12.pdf
PDF
How to Install Plex Media Server on Debian 12.pdf
PDF
How to Install KVM (Kernel-based Virtual Machine) on Debian 12
PDF
How to Install Nextcloud on Debian 12.pdf
PDF
How to Install VNC Server on Debian 12.pdf
How to Upgrade Linux Mint From 21 to 22.pdf
How to Install VirtualBox on Linux Mint 22.pdf
How to Install VMware Workstation on Linux Mint 22.pdf
How to Install Google Chrome on Ubuntu 24.04.pdf
How to Install XRDP on Debian 12 Server.pdf
How to Install Apache on Debian 12 Server
How to Install OpenJDK on Debian 12 Server.pdf
How to Install Cuda on Debian 12 Server.pdf
How to Install GCC Compiler on Debian 12.pdf
How to Install UFW Firewall on Debian 12.pdf
How to Check the Kernel Version in Debian 12.pdf
How to Install and Configure MariaDB on Debian 12.pdf
How to Install Python on Debian 12 Server
How to Install phpMyAdmin on Debian 12.pdf
How to Install and Configure Webmin on Debian 12.pdf
How to Change an IP Address on Debian 12.pdf
How to Install Plex Media Server on Debian 12.pdf
How to Install KVM (Kernel-based Virtual Machine) on Debian 12
How to Install Nextcloud on Debian 12.pdf
How to Install VNC Server on Debian 12.pdf
Ad

Recently uploaded (20)

PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Spectroscopy.pptx food analysis technology
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Cloud computing and distributed systems.
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
Reach Out and Touch Someone: Haptics and Empathic Computing
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Understanding_Digital_Forensics_Presentation.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Unlocking AI with Model Context Protocol (MCP)
sap open course for s4hana steps from ECC to s4
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
MYSQL Presentation for SQL database connectivity
Per capita expenditure prediction using model stacking based on satellite ima...
Spectral efficient network and resource selection model in 5G networks
Review of recent advances in non-invasive hemoglobin estimation
Spectroscopy.pptx food analysis technology
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Cloud computing and distributed systems.
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Network Security Unit 5.pdf for BCA BBA.
Mobile App Security Testing_ A Comprehensive Guide.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation

How to Install NFS Server and Client on Ubuntu 2404.pdf

  • 1. 1/11 April 3, 2025 How to Install NFS Server and Client on Ubuntu 24.04 greenwebpage.com/community/how-to-install-nfs-server-and-client-on-ubuntu-24-04/ Tutorials by Karim Buzdar April 3, 2025 NFS (Network File System) is a file system that allows file sharing over the local file system. It is commonly used in Linux environments, especially in Ubuntu 24.04. NFS makes file sharing easy between different machines and users. It eliminates the burden faced by individual file servers and allows users to access shared files from a centralized server. The use of NFS has increased dramatically in data centers, media rooms, and dev teams. This detailed tutorial will contain step-by-step instructions on how you can install and set up NFS on Ubuntu 24.04. How to Install NFS on Ubuntu 24.04 In simpler words, NFS is centralized storage for information such as text documents, images and videos. It saves these so that multiple systems can easily access them. Prerequisites You will need the following to install NFS: Two Ubuntu 24.04 Systems: One can be used as the server the other as a client.
  • 2. 2/11 Root or Sudo Access: You must have the correct permission to log in as root or user sudo to make changes to the setup or settings of NFS. Network Connectivity: Ensure same network information for both machines so that they can communicate with one another. Step 1: Install NFS Server on Ubuntu 24.04 The first step is to install an NFS server package on the system, which will act as the server. To do so: Update the Package List: Execute the following command to update your package list: sudo apt update Install the NFS Kernel Server: To install the NFS server package, execute the command shown below: sudo apt install nfs-kernel-server
  • 3. 3/11 Confirm the Installation: To confirm that NFS service is active, run the command. Now, you receive a status response with an active running state for NFS: sudo systemctl status nfs-kernel-server Step 2: Configure the NFS Server After installing the NFS server, users need to configure it to share directories: Create a Shared Directory: In case you need to share any directories, create a shared one in the root home and name it for ease: sudo mkdir -p /mnt/nfs_share
  • 4. 4/11 Set Directory Permissions: Adjust the permissions of the shared directory to ensure clients can access it: sudo chown nobody:nogroup /mnt/nfs_share Grant the restricted level access permissions to ensure clients can access it. sudo chmod 777 /mnt/nfs_share Edit the Exports File: After that, open the /etc/exports file, which contains the shared and client access configurations: sudo nano /etc/exports
  • 5. 5/11 You can replace client_ip with the specific address of the system with which you would like to share it: /mnt/nfs_share client_ip(rw,sync,no_subtree_check) These are the conditions that will be active on sharing domains: rw: read-write permission, granting the ability to write and edit the directory. sync: Requests acknowledgment will only be given after the changes have been successfully written to the disk. no_subtree_check: Here, performance is improved by turning off subtree check. To allow sharing the directory for all clients in a subnet, do the following: /mnt/nfs_share 192.168.1.0/24(rw,sync,no_subtree_check)
  • 6. 6/11 Export the Shared Directory: After the changes have been made, the next step to take is to export the shared directory: sudo exportfs -a Restart the NFS Server: The next step is to restart the NFS service so that the system can make use of the new configuration: sudo systemctl restart nfs-kernel-server Step 3: Allow Clients Through Firewall For those making use of UFW, you have to allow clients through the firewalls: sudo ufw allow from [clientIP or clientSubnetIP] to any port nfs
  • 7. 7/11 To confirm that this operation has been completed, type the following: sudo ufw status Step 4: Install NFS Client on Ubuntu 24.04 Install the NFS client package in the client machine to enable access to the shared directory. To do so: Update the Package List: Do the following to update the package list: sudo apt update Install the NFS Client: Install the NFS client package: sudo apt install nfs-common
  • 8. 8/11 Step 5: Mount the NFS Share on the Client After you install the NFS client, you will be able to mount the directory shared on the server: Create a Mount Point: Make a directory that will hold the shared files that are accessible: sudo mkdir -p /mnt/nfs_client_share Mount the NFS Share: Use this command to mount the shared directory (make sure to put server_ip where the address of the NFS server is): sudo mount server_ip:/mnt/nfs_share /mnt/nfs_client_share Verify the Mount: To check whether the NFS share has been mounted: df -h
  • 9. 9/11 After executing the command, the shared directory should be present among other items. Step 6: Automount the NFS Share (Optional) If you want to mount the NFS share automatically at boot, add an entry in /etc/fstab. Edit the fstab File: Open the file using a text editor of your choice: sudo nano /etc/fstab Add the NFS Share: Add this line to the file (make sure you put the NFS server’s IP address instead of server_ip): server_ip:/mnt/nfs_share /mnt/nfs_client_share nfs defaults 0 0
  • 10. 10/11 Test the Configuration: Test the configuration by unmounting and remounting all filesystems: sudo umount /mnt/nfs_client_share Now, mount all filesystems listed in the /etc/fstab file, typically used during system startup or to apply changes made to the file: sudo mount -a Step 7: Test the NFS Setup Finally, check that the NFS setup works by performing the following steps: Create a Test File on the Server: On the server, navigate to the shared location and create the file: sudo touch /mnt/nfs_share/testfile.txt
  • 11. 11/11 Verify on the Client: On the client side, confirm the accessibility of the created file: ls /mnt/nfs_client_share The output shows the testfile.txt in the client side. Some Issues and Their Solutions Permission Denied: Check that the shared directory’s permissions are correctly set and that the client IP is accepted in the /etc/exports file. Mount Failure: Check that the NFS service on the server is active and that the client can connect to the server through the network. Firewall Blocking: Check that the server firewall is set to permit the NFS service (ports 2049, 111, and others). Conclusion Installing NFS on Ubuntu 24.04 is simple. It allows for more efficient file sharing and retrieval between systems. This guide ensures that NFS is installed and configured adequately on the server and client sides. NFS is beneficial for data center management, developing teams, or media production settings because it simplifies file sharing and collaboration.