Or copy link
Copy link
NFS, which stands for Network File System, is a tool that lets you share files over a network. Having a folder on one computer that others can open, edit, and save files to, just like it’s on their own machine. For Ubuntu users, NFS is particularly useful. It means you can have one central spot for all your files, which anyone on your network can use without needing to transfer files back and forth.
This setup is perfect for groups working on projects or for anyone who wants easy access to shared resources. It simplifies file management, reduces clutter, and speeds up collaborative work. This article will guide you through how to setup NFS on Ubuntu system, turning it into a file-sharing hub for your network.
Before diving into the Ubuntu NFS server installation, ensure your system’s package list is up to date and all installed software is at the latest version:
sudo apt update && sudo apt upgrade -y
Next, install NFS server Ubuntu package:
sudo apt install nfs-kernel-server
Purpose: This command installs the necessary software to run an NFS server on your Ubuntu machine.
Create a directory specifically for NFS sharing:
sudo mkdir /var/nfs/share -p
-p
Adjust the ownership and permissions:
sudo chown nobody:nogroup /var/nfs/share && sudo chmod 777 /var/nfs/share
nobody
nogroup
Edit the NFS export file to define access:
sudo nano /etc/exports
nano is a simple text editor. Here, you define which directories are shared and with what permissions.
Add your share configuration:
sudo /var/nfs/share 192.168.1.0/24(rw,sync,no_subtree_check)
This line specifies that the /var/nfs/share directory is shared with the network 192.168.1.0/24, allowing read/write (rw) access, using synchronous writes (sync), and disabling subtree checking for performance.
/var/nfs/share
192.168.1.0/24
rw
sync
Apply the export settings:
sudo exportfs -a
exportfs -a exports all directories listed in /etc/exports, making them available to clients.
/etc/exports
To ensure the NFS server runs:
sudo systemctl start nfs-server && sudo systemctl enable nfs-server && sudo systemctl status nfs-server
Install and Configure NFS on Our Ubuntu VPS!
Combine the reliability of the world’s leading Linux distribution with the flexibility of a VPS, and enjoy lightning-fast performance.
If you have install UFW on Ubuntu system, configure it to allow NFS traffic:
sudo ufw allow from 192.168.1.0/24 to any port nfs && sudo ufw enable && sudo ufw status
On your client machine, install the NFS client:
sudo apt install nfs-common
Purpose: Install client utilities needed to mount NFS shares.
Mount the NFS share:
sudo mount server_IP:/var/nfs/share /mnt
This command mounts the shared directory from the server to the local /mnt directory.
/mnt
For a persistent mount:
echo 'server_IP:/var/nfs/share /mnt nfs auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0' | sudo tee -a /etc/fstab
Adds an entry to /etc/fstab for automatic mounting at boot. The options ensure the system doesn’t hang if the NFS server is down (nofail), optimizes performance, and handles file locking.
/etc/fstab
nofail
Learn about How to Install Logwatch on Ubuntu.
NFS, or Network File System, is a distributed file system protocol that allows files to be shared across a network. It enables users to access and share files on remote systems as if they were local.
NFS is built on the concept of a client-server architecture, where the server hosts the shared files and the clients access them through the network. NFS is a valuable tool for collaborative work, simplifying file management and reducing clutter. It is widely used in various environments, including office networks, data centers, and cloud computing platforms.
NFS is essential for several reasons:
The benefits of using NFS include:
By following this guide, you’ve learned how to implement NFS on your Ubuntu server. We started with the basics: updating your system, installing the NFS server, and creating a shareable directory. We configured access rights, ensuring only the right people can get to your files, and set up the firewall to keep everything secure.
We also covered how to connect client machines to this shared space. Now, your Ubuntu server is not just a computer; it’s a central file repository that enhances teamwork by providing seamless file access. With NFS configured, you’ve streamlined how files are shared and accessed across your network, making data management both easier and more efficient. Remember, while NFS boosts convenience, always keep an eye on security and performance tweaks to match your specific needs.
Installing NFS on Ubuntu can be a simple process. Upgrading to an Ultahost Linux VPS server provides a more powerful and affordable environment to configure the NFS setup. These VPS plans offer processing power, RAM, and storage, ensuring smooth performance.
NFS (Network File System) is a protocol that allows a system to share directories and files with others over a network. It enables a client system to access files on a server as if they were on the client’s local storage.
Use Ubuntu 20.04 LTS or later, root or sudo access, and network connectivity.
Open a terminal and run:
On the client machine, run:
Perl, short for Practical Extraction and Reporting Lang...
RTMP stands for Real-Time Messaging Protocol and is a w...
Node Package Manager (npm) is an excellent tool for Jav...
As a Ubuntu user, managing video and audio files can be...
In Ubuntu 22.04, UFW stands for Uncomplicated Firewall....
Chromium is an open-source web browser project that ser...
Save my name, email, and website in this browser for the next time I comment.
Δ