Share files over NFS with File Storage on Ubuntu

Last updated on: November 27, 2026

Introduction

This guide walks you through mounting a File Storage share on Ubuntu Cloud Servers over NFS (Network File System), so that several servers can work with the same files.

Prerequisites

Before starting this guide, you need:

File Storage & NFS basics

File Storage is UpCloud's managed network storage service that provides shared storage accessible over your SDN Private Networks. It's ideal for:

  • Shared application data across multiple servers
  • Centralized file storage for web applications
  • Storing backups and logs
  • Content management systems requiring shared media storage

NFS (Network File System) is a distributed file system protocol that allows you to mount remote directories on your server. It enables multiple servers to access the same files simultaneously, making it perfect for use with File Storage.

Creating the client server

Now create an Ubuntu server that will access the File Storage:

  1. In the Control Panel, navigate to Servers → Deploy server
  2. Configure your server:
    • Location: Select the same location as your File Storage
    • Plan: Select a server plan based on your needs
    • Operating system: Choose Ubuntu 24.04 LTS or later
  3. Under Network, select Attach private network
  4. Select the SDN Private Network that your File Storage is attached to
  5. Pick or create an SSH key
  6. Hostname: Give it a descriptive name (e.g., "nfs-client-01")

Wait for the server to be provisioned and start. Once it's running, connect to it via SSH using the configured SSH key.

Install NFS client on Ubuntu

Connect to your Ubuntu server via SSH and install the NFS client packages:

sudo apt update
sudo apt install nfs-common -y

The nfs-common package provides the necessary tools to mount NFS shares on Ubuntu.

Mount the File Storage share

Create a mount point

First, create a directory where the File Storage will be mounted:

sudo mkdir -p /mnt/shared

Mount the NFS share

Mount the share using the File Storage IP address and the share path. Replace FILE_STORAGE_IP with the actual IP address from your File Storage instance:

sudo mount -t nfs FILE_STORAGE_IP:/data /mnt/shared

For example, if your File Storage IP is 192.168.0.100:

sudo mount -t nfs 192.168.0.100:/data /mnt/shared

Verify the mount:

df -h | grep /mnt/shared

You should see output showing the mounted File Storage with its total size and available space.

Make the mount persistent

To ensure the File Storage is automatically mounted after server reboots, add an entry to /etc/fstab. Add the following line at the end of the file (replace FILE_STORAGE_IP with your actual IP):

FILE_STORAGE_IP:/data /mnt/shared nfs defaults,_netdev,vers=4.1,nconnect=8,rsize=1048576,wsize=1048576,noatime,hard  0  0

The _netdev option ensures the system waits for network connectivity before attempting to mount the share. The mount options have been optimized for best performance.

Test the fstab entry:

sudo umount /mnt/shared
sudo mount /mnt/shared

Verify the mount is successful:

df -h | grep /mnt/shared

Test the File Storage

Now test that you can read and write to the File Storage:

Create a test file

echo "Hello from File Storage!" > /mnt/shared/test.txt

Read the test file

cat /mnt/shared/test.txt

You should see the output: Hello from File Storage!

Test from multiple servers

To demonstrate the shared nature of File Storage:

  1. Create another Ubuntu Cloud Server following the same steps
  2. Attach it to the same SDN Private Network
  3. Install the NFS client and mount the same File Storage share
  4. You'll be able to see the same files on both servers
  5. Changes made on one server are immediately visible on the other

Performance considerations

The fstab entry in this guide uses the mount options we recommend for File Storage shares. For what each option does, see How to get started with File Storage.

Troubleshooting

Mounting fails

  • Verify your server is attached to the correct SDN Private Network
  • Check that the File Storage instance is reachable: ping FILE_STORAGE_IP
  • Ensure your firewall rules allow NFS traffic (TCP port 2049)
  • Check the share's access rights in the Control Panel
  • Verify your server's SDN Private Network IP is allowed in the share configuration

Mount becomes unresponsive

  • Check network connectivity to the File Storage: ping FILE_STORAGE_IP
  • Verify the File Storage instance is running in the Control Panel
  • Check system logs for errors: sudo journalctl -xe | grep nfs
Contributed by: Juha-Pekka Järvenpää

Can't find what you're looking for?

For more help you can contact our awesome 24/7 support team

Contact Support