We're here to assist with any of your needs, don't hestitate to reach out.
NFS (Network File System) is a distributed file system protocol that allows you to share files and folders across a network. It is commonly used in server-client environments to provide centralized storage.
Before installing NFS, it is always recommended to update the system packages to their latest versions. Open the terminal and run the following commands:
sudo apt update
sudo apt upgrade
To install the NFS server on Ubuntu 20.04, run the following command:
sudo apt install nfs-kernel-server
NFS uses the concept of exports, which are directories that are shared with clients over the network. To configure NFS exports, open the exports file using a text editor:
sudo nano /etc/exports
Within the file, add a line for each directory you want to share. The syntax is as follows:
/path/to/directory client(options)
For example, to share the directory "/home/nfs" with a client at IP address "192.168.1.100" and give them read-write access, add the following line:
/home/nfs 192.168.1.100(rw,sync,no_subtree_check)
Save the file and exit the editor.
After configuring the exports, start the NFS server using the following command:
sudo systemctl start nfs-server
You can also enable the NFS server to automatically start at boot:
sudo systemctl enable nfs-server
If you have a firewall enabled on your system, you need to allow NFS traffic. Run the following commands to allow NFS:
sudo ufw allow from 192.168.1.100 to any port nfs
sudo ufw enable
To access NFS shares on client machines, you need to mount them. On the client machine, run the following command:
sudo mount server:/path/to/directory /mnt
Replace "server" with the IP address or hostname of the NFS server, and "/path/to/directory" with the shared directory you want to mount. The mount point "/mnt" is just an example - you can choose any empty directory as the mount point on the client.
Congratulations! You have successfully installed and configured NFS on Ubuntu 20.04. You can now use NFS to share files and folders across your network.
What our customers say about us
Create your free account today.