Setting Up an NFS Server in Ubuntu

Orange Pi Development Boards

You may need to setup an NFS server on Ubuntu to run and debug your program on your target platform or simply to share media files on the network composed of Linux clients. If you are using Windows clients, you would usually use SAMBA/CIFS, although it is possible to setup an NFS server in Windows as well using Windows Services for UNIX 3.5.

Quick Guide to to setup an NFS server in Ubuntu without authentication.

Install the required packages:

# sudo apt-get install nfs-kernel-server nfs-common portmap

Reconfigure and restart portmap:

# sudo dpkg-reconfigure portmap
# sudo /etc/init.d/portmap restart

Edit /etc/exports:

# sudo vi /etc/exports

Add the directories to share with NFS and save the file, for example:


will give full read/write permissions to the nfs directory for computer in subnet.

Restart the NFS server:

# sudo /etc/init.d/nfs-kernel-server restart

and reload the configuration:

# sudo exportfs -a

The installation is now complete.

To mount the NFS server (nfs directory) from another client (in /mnt/nfs), use the following command line:

# mount nfs_server_ip:/nfs /mnt/nfs

Support CNX Software - Donate via PayPal or become a Patron on Patreon

Leave a Reply

4 Comment threads
0 Thread replies
Most reacted comment
Hottest comment thread
1 Comment authors
How-to Boot a Headless Linux Image on Amlogic S802 TV Boxes (Tronsmart Vega S89 Elite)Raspberry Pi Now Has Experimental Support for VP6, VP8, MJPEG and Ogg Theora Video Codecscnxsoft Recent comment authors
newest oldest most voted
Notify of

[…] in the Raspberry Pi and access the rootfs via NFS. So let’s configure the Raspberry Pi as a NFS server […]


[…] Instructions to install an NFS server on Ubuntu/Debian. […]