How to Configure A NFS File Server On Ubuntu 18.04 Bionic Beaver

Install NFS server:

sudo apt install nfs-kernel-server

Open /etc/exports

33 corresponds here to the user www-data, because otherwise this leads to problems with the release. The user ID must be the same as on the target system. All files should belong to this owner.

/mnt/HC_Volume_12345	x.x.x.x (rw,sync,anonuid=33,anongid=33)
/mnt/HC_Volume_12345	x.x.x.x (rw,sync,anonuid=33,anongid=33)
/mnt/HC_Volume_12345/fileadmin	x.x.x.x (rw,sync,anonuid=33,anongid=33)

restart so that changes become active

sudo systemctl restart nfs-kernel-server

Client Setup

Install nfs client packages:

sudo apt install nfs-common

set up mounts in /etc/fstab

x.x.x.x:/mnt/HC_Volume_12345	/var/www/html	nfs defaults,user,exec		0 0

During daily administration tasks, settings in the /etc/fstab file may have to be adjusted from time to time. In most cases, however, it is not possible to restart the system afterwards. Therefore, the settings must be transferred to the running system via a different path. Do it like this:

sudo mount -a

Be the first to comment

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.