> ## Content Index
> Fetch the complete content index at: https://blog.alphavps.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# How to Configure NFS Server and Client on Ubuntu 24.04 VPS
- URL: https://blog.alphavps.com/how-to-configure-nfs-server-and-client-on-ubuntu-24-04-vps/
- Published: 2025-11-27T12:24:50.000Z
- Updated: 2026-09-08T15:18:13.000Z
- Author: Karim Buzdar
- Tags: Tutorials, Ubuntu, Networking, Backups & Storage

The Network File System is an efficient and powerful way to share files across Linux systems. Multiple clients can access the same files just like they were locally, which makes it perfect for environments such as Kubernetes, shared data servers, or development teams. This guide will show you how to install an NFS client and server on a Ubuntu 24.04 virtual private server.

## **How to Configure NFS Server and Client on a Ubuntu 24.04 VPS**

To configure NFS on Ubuntu, install nfs kernel-server and nfs common on both the server and client to configure NFS on Ubuntu 24.04\. Export a shared directory from the server using /etc/exports. Then, use sudo exportfs to apply the changes. Mount the shared directory using sudo mount on the client. You can access files via the network by using:/shared/path/mount/point.

**Prerequisites**

Installing NFS requires the following:

- **Two Ubuntu 24.04 Systems**: One system can be used for the server, and the other one as a client.
- **Root or Sudo Access**: To make changes to NFS settings or setup, you must be able to log in as root or sudo.
- **Network Connectivity**: Both machines must have the same network details so they can communicate.

If you don’t already have a server prepared, you can easily deploy one of our [Storage VPS plans](https://alphavps.com/storage-vps.html?ref=blog.alphavps.com). They’re ideal for NFS use cases, providing large, RAID-protected storage and stable network performance — perfect for shared storage, backups, or distributed environments.

For this guide:

- **NFS Server IP**: 192.168.0.110
- **NFS Client IP**: 192.168.0.116

(Replace these with your actual IPs.)

### **Step 1: Install NFS Server on Ubuntu 24.04 VPS**

Installing an NFS Server package on the system that will be the server is the first step. To do so:

**Update the Package List:**

Update your package list by using the following command:

```bash
sudo apt update
```

![](https://blog.alphavps.com/content/images/2025/10/data-src-image-2f0f3f2f-7b14-4964-ad87-af4ed11a869b.png)

**Install the NFS Kernel Server:**

Execute the following command to install the NFS Server Package:

```bash
sudo apt install nfs-kernel-server
```

![](https://blog.alphavps.com/content/images/2025/10/data-src-image-c66d269f-8587-43f7-8263-cbce58232abf.png)

**Confirm the Installation:**

Run the command to confirm that the NFS is running. You will receive a response indicating that NFS is currently running:

```bash
sudo systemctl status nfs-kernel-server
```

![](https://blog.alphavps.com/content/images/2025/10/data-src-image-30a665df-2202-415a-8358-624c50d0bd87.png)

### **Step 2: Configure the NFS Server**

Users must configure the NFS server to share directories after installing it:

**Create a Shared Directory:**

Create a shared directory in your root home. Name it something easy to remember.

```bash
sudo mkdir -p /mnt/nfs_share
```

![](https://blog.alphavps.com/content/images/2025/10/data-src-image-0319d28e-3400-4e0e-825d-afcd3e60cb7e.png)

**Set Directory Permissions:**

Change the permissions on the shared directory so that clients can access it.

```bash
sudo chown nobody:nogroup /mnt/nfs_share
```

![](https://blog.alphavps.com/content/images/2025/10/data-src-image-60ee9f02-5870-432f-af19-2b07d7f9055a.png)

Access the restricted level of access to make sure clients can access.

```bash
sudo chmod 777 /mnt/nfs_share
```

![](https://blog.alphavps.com/content/images/2025/10/data-src-image-9497c0fb-5f16-4b86-b439-0c5d7bf11d6f.png)

**Edit the Exports File:**

Open the /etc/exports, which contains shared and client access settings:

```bash
sudo nano /etc/exports
```

![](https://blog.alphavps.com/content/images/2025/10/data-src-image-b6b21755-35e9-4102-919d-10ef3121a4b7.png)

Replace client\_ip with the address of the system you wish to share the data with:

```bash
/mnt/nfs_share client_ip(rw,sync,no_subtree_check)
```

![](https://blog.alphavps.com/content/images/2025/10/data-src-image-125a3430-563f-4a10-9d4c-b50dba0e21dd.png)

The following conditions will apply to domain sharing:

**rw**: read-write permission, granting the ability to write and edit the directory. 

**sync**: Requests acknowledgment will only be given after the changes have been successfully written to the disk.

**no\_subtree\_check**: Here, performance is improved by turning off the subtree check.

Do the following to allow all clients on a subnet to share the directory:

```bash
/mnt/nfs_share 192.168.1.0/24(rw,sync,no_subtree_check)
```

![](https://blog.alphavps.com/content/images/2025/10/data-src-image-145f71a1-dcd6-4229-9816-dc1126b5a6d6.png)

**Export the Shared Directory:**

The next step is to export the shared folder after the changes are made:

```bash
sudo exportfs -a
```

![](https://blog.alphavps.com/content/images/2025/10/data-src-image-aecd3423-aa15-48f9-a17c-93a07bbe367b.png)

**Restart the NFS Server:**

Next, restart the NFS server so that it can use the new configuration.

```bash
sudo systemctl restart nfs-kernel-server
```

![](https://blog.alphavps.com/content/images/2025/10/data-src-image-66d86ecf-ee27-4b86-9aa4-476a5634467b.png)

### **Step 3: Allow Clients Through Firewall**

You must allow access to clients who use UFW:

```bash
sudo ufw allow from [clientIP or clientSubnetIP] to any port nfs
```

![](https://blog.alphavps.com/content/images/2025/10/data-src-image-daf7e144-deb9-4433-b495-b9bfb9ee39a8.png)

Type the following to confirm that this operation is complete:

```bash
sudo ufw status
```

![](https://blog.alphavps.com/content/images/2025/10/data-src-image-aa17ceb0-0fb8-4dec-8f18-1ac29314101c.png)

### **Step 4: Install NFS Client on Ubuntu 24.04 VPS**

Install the NFS Client package on the client computer to enable access to a shared directory. To do so:

**Update the Package List:**

Update the package list by following these steps:

```bash
sudo apt update
```

![](https://blog.alphavps.com/content/images/2025/10/data-src-image-2353e568-effd-4339-b23e-60fb3c3bb00e.png)

**Install the NFS Client:**

Install the NFS client package:

```bash
sudo apt install nfs-common
```

![](https://blog.alphavps.com/content/images/2025/10/data-src-image-0f234c35-b1ab-4b1c-b9c5-4e69667b725e.png)

### **Step 5: Mount the NFS Share on the Client**

You can mount the shared directory on the server after installing the NFS client:

**Create a Mount Point:**

Create a directory to hold all the files that can be accessed by everyone:

```bash
sudo mkdir -p /mnt/nfs_client_share
```

![](https://blog.alphavps.com/content/images/2025/10/data-src-image-902c20e5-29a2-4e64-9fc9-f8c633b27ec9.png)

**Mount the NFS Share:**

Use this command to mount a shared directory. (Make sure you put server\_ip in the place where the NFS address is.)

```bash
sudo mount server_ip:/mnt/nfs_share /mnt/nfs_client_share
```

![](https://blog.alphavps.com/content/images/2025/10/data-src-image-f3c047d3-99ab-42a4-bbf0-e92d01874adf.png)

**Verify the Mount:**

Check if the NFS shares have been mounted:

```bash
df -h
```

![](https://blog.alphavps.com/content/images/2025/10/data-src-image-c04bde13-d9b6-4337-8421-84cd9c25b945.png)

The shared directory will appear after executing the command.

### **Step 6: Automount the NFS Share (Optional)**

Add an entry to /etc/fstab if you want the NFS share mounted automatically when booting.

**Edit the fstab File:**

Open the file with a text editor:

```bash
sudo nano /etc/fstab
```

![](https://blog.alphavps.com/content/images/2025/10/data-src-image-ad4baa54-ce6f-459a-9758-a9f9f016ff54.png)

**Add the NFS Share:**

Add this line to the file. Make sure to use the IP address of the NFS server instead of server\_ip.

```bash
server_ip:/mnt/nfs_share /mnt/nfs_client_share nfs defaults 0 0
```

![](https://blog.alphavps.com/content/images/2025/10/data-src-image-622475f2-f3e8-4eac-94e4-189dd1c23cc0.png)

**Test the Configuration:**

Test the configuration after unmounting and then remounting all filesystems.

```bash
sudo umount /mnt/nfs_client_share
```

![](https://blog.alphavps.com/content/images/2025/10/data-src-image-82754dab-6903-4a77-8db3-5f2c3f979ab6.png)

Mount all the filesystems in the /etc/fstab directory. This file is typically used to start the system or to apply any changes to it.

```bash
sudo mount -a
```

![](https://blog.alphavps.com/content/images/2025/10/data-src-image-8e38416a-13a9-49ed-b425-07fdfc0dba1b.png)

### **Step 7: Test the NFS Setup**

Check that NFS is working by following these steps:

**Create a Test File on the Server:**

Create the file by navigating to the shared location on the server:

```bash
sudo touch /mnt/nfs_share/testfile.txt
```

![](https://blog.alphavps.com/content/images/2025/10/data-src-image-ebbdcb3d-401f-4ff8-a953-d76e41e20e44.png)

**Verify on the Client:**

Confirm the file's accessibility on the client side:

```bash
ls /mnt/nfs_client_share
```

![](https://blog.alphavps.com/content/images/2025/10/data-src-image-10ce5ad6-0dbc-4e6d-8478-b0c06be5945f.png)

The client-side output displays the file testfile.txt.

Following these steps will allow you to successfully install an NFS client and server on your Ubuntu 24.04 VPS.

## **Conclusion**

NFS is an easy-to-use, yet powerful, solution for sharing data. It's widely used by enterprise systems, virtualization platforms, and container orchestration tools like Kubernetes. You now have the foundation to create a collaborative Linux environment with distributed storage. You've now created a shared directory on your NFS server that clients can access and mount over the network. This is a great way to centralize or share files in Linux environments.

If you’re planning to launch an online project and need [**Storage VPS**](https://alphavps.com/storage-vps.html?ref=blog.alphavps.com), get in touch with us — our experts will provide a solution tailored to your needs and goals.