How to set up an NFS share between Linux servers
Updated 11/29/2026
NFS lets you share a directory from one server (the NFS server) to other servers (clients), which use it as if it were local. Useful for common files across several app servers.
On the NFS server
apt-get install -y nfs-kernel-server
mkdir -p /export/data
In /etc/exports, allow the clients (ideally only from the private network):
/export/data 10.10.0.0/24(rw,sync,no_subtree_check)
exportfs -a
systemctl restart nfs-kernel-server
On the client servers
apt-get install -y nfs-common
mkdir -p /mnt/data
mount 10.10.0.1:/export/data /mnt/data
Automatic mount
In /etc/fstab on the client:
10.10.0.1:/export/data /mnt/data nfs _netdev 0 0
Security
Run NFS only over a private network, never directly on the internet, and restrict access with the firewall.
Put this guide into practice on your own VPS
EU cloud servers, billed hourly, ready in minutes, with one-click installs for dozens of apps.
See pricingRelated tutorials
How to sync files automatically with Syncthing
Syncthing syncs files in real time between servers and devices, encrypted and without an external cloud.
Updated 11/29/2026Storage & filesHow to self-host S3 storage with MinIO
MinIO gives you S3-compatible storage on your own server, ideal for apps that expect an S3 API.
Updated 11/29/2026Storage & filesHow to encrypt files and backups
Protect sensitive data by encrypting files and backups before storing or transferring them.
Updated 11/29/2026