How To Install and Configure NFS Server On Ubuntu 24.04 | Simple Guide

Опубликовано: 18 Декабрь 2025
на канале: LinuxTechi
1,037
9

Learn how to install and configure an NFS (Network File System) server on Ubuntu 24.04 in this easy-to-follow tutorial! NFS is a powerful way to share files and directories across a network. Follow these steps to get started:

*Steps Covered:*

1️) *Install Updates:* Keep your system up to date by running:

sudo apt update && sudo apt upgrade -y

2️) *Install NFS Server:*
Install the NFS server package:
sudo apt install nfs-kernel-server -y

3️) *Create and Configure Shared Directory:*
Set up the directory to share:
sudo mkdir -p /var/nfs_share sudo chmod 777 /var/nfs_share

4️) *Configure NFS Exports:*
Edit the configuration file to define access rules:
sudo vi /etc/exports
Example entry:
/var/nfs_share 192.168.1.0/24(rw,sync,no_subtree_check)

5️) *Export the Shared Directory:*
Apply the changes:
sudo exportfs -a
sudo exportfs -v

6️) *Allow NFS Ports in Firewall:*
Configure the firewall:
sudo ufw allow from 192.168.1.0/24 to any port nfs
sudo ufw reload
sudo ufw status

7️) *Mount NFS Share on Client Machine:*
Install the client package and mount the share:
sudo dnf install nfs-utils -y sudo mount 192.168.1.11:/var/nfs_share /mnt

For permanent mounting,
edit `/etc/fstab`:
192.168.1.10:/var/nfs_share /mnt/ nfs defaults 0 0


Enjoy seamless file sharing with your NFS setup! Don’t forget to like, subscribe, and comment below. Let us know if you have any questions! 🚀

#Ubuntu #NFSServer #LinuxTutorial