Skip to content

Setting Up an NFS Server and Client on CentOS 9

Netcloud24
Cloud Infrastructure Expert
NetCloud24 Expert Guides Open the dedicated video page

Video transcript: NetCloud24 Expert Guides. Practical knowledge for a reliable cloud. Cloud and VPS expertise, security, performance, and step-by-step tutorials. Learn, deploy, and keep building with NetCloud24.

 

 

Introduction

NFS (Network File System) allows you to share directories and files between systems over a network. In this guide, you will learn how to set up an NFS server and client on CentOS 9, which can be efficiently hosted on a for optimal performance.

Prerequisites

  • A CentOS 9 server with root access
  • Basic knowledge of Linux commands
  • An active internet connection

Step 1: Update Your System

Start by updating your package index:

sudo dnf update -y

Step 2: Install NFS Utilities

Install the NFS utilities package:

sudo dnf install nfs-utils -y

Step 3: Create a Directory to Share

Create a directory that you want to share over NFS:

sudo mkdir -p /mnt/nfs_share

Step 4: Configure NFS Exports

Edit the NFS exports file to specify which directory to share:

Visual overview of Setting Up an NFS Server and Client on CentOS 9
Visual overview: Setting Up an NFS Server and Client on CentOS 9
sudo nano /etc/exports

Add the following line to share the directory with specific clients:

/mnt/nfs_share *(rw,sync,no_root_squash)

This configuration allows any client to access the share with read and write permissions.

Step 5: Start the NFS Service

Start the NFS service and enable it to run at boot:

sudo systemctl start nfs-server
sudo systemctl enable nfs-server

Step 6: Export the Shared Directory

Run the following command to export the shared directory:

sudo exportfs -a

Step 7: Configure Firewall

Allow NFS traffic through the firewall:

sudo firewall-cmd --add-service=nfs --permanent
sudo firewall-cmd --add-service=mountd --permanent
sudo firewall-cmd --add-service=rpc-bind --permanent
sudo firewall-cmd --reload

Step 8: Set Up NFS Client

On the client machine, install the NFS utilities:

sudo dnf install nfs-utils -y

Step 9: Create a Mount Point on the Client

Create a directory where the NFS share will be mounted:

Key topics covered in Setting Up an NFS Server and Client on CentOS 9
Key topics covered in this NetCloud24 guide.
sudo mkdir -p /mnt/nfs_client

Step 10: Mount the NFS Share

Mount the NFS share on the client:

sudo mount -t nfs server_ip:/mnt/nfs_share /mnt/nfs_client

Replace server_ip with the actual IP address of your NFS server.

Step 11: Verify the Mount

Check if the NFS share is mounted correctly:

df -h

Step 12: Automate Mounting at Boot (Optional)

To ensure the NFS share mounts automatically at boot, add the following line to /etc/fstab on the client:

server_ip:/mnt/nfs_share /mnt/nfs_client nfs defaults 0 0

Step 13: Conclusion

You have successfully set up an NFS server and client on CentOS 9. This configuration allows for efficient file sharing across systems, making it ideal for collaboration in environments like a . For additional options, explore various solutions, including Windows VPSVirtual Private Server Hosting and Windows VPS Hosting UK for optimal performance and security.

© 2024 NFS Setup Tutorial. All rights reserved.

Practical checklist for Setting Up an NFS Server and Client on CentOS 9
Practical checklist for applying the guidance in this article.
Setting Up an NFS Server and Client on CentOS 9
Setting Up an NFS Server and Client on CentOS 9
Explore more

More on this topic

Netcloud24
Netcloud24
Cloud Infrastructure Expert · NetCloud24

Comments are closed.

Setting Up an NFS Server and Client on CentOS 9

Netcloud24
Cloud Infrastructure Expert
NetCloud24 Expert Guides Open the dedicated video page

Video transcript: NetCloud24 Expert Guides. Practical knowledge for a reliable cloud. Cloud and VPS expertise, security, performance, and step-by-step tutorials. Learn, deploy, and keep building with NetCloud24.

 

 

Introduction

NFS (Network File System) allows you to share directories and files between systems over a network. In this guide, you will learn how to set up an NFS server and client on CentOS 9, which can be efficiently hosted on a for optimal performance.

Prerequisites

  • A CentOS 9 server with root access
  • Basic knowledge of Linux commands
  • An active internet connection

Step 1: Update Your System

Start by updating your package index:

sudo dnf update -y

Step 2: Install NFS Utilities

Install the NFS utilities package:

sudo dnf install nfs-utils -y

Step 3: Create a Directory to Share

Create a directory that you want to share over NFS:

sudo mkdir -p /mnt/nfs_share

Step 4: Configure NFS Exports

Edit the NFS exports file to specify which directory to share:

Visual overview of Setting Up an NFS Server and Client on CentOS 9
Visual overview: Setting Up an NFS Server and Client on CentOS 9
sudo nano /etc/exports

Add the following line to share the directory with specific clients:

/mnt/nfs_share *(rw,sync,no_root_squash)

This configuration allows any client to access the share with read and write permissions.

Step 5: Start the NFS Service

Start the NFS service and enable it to run at boot:

sudo systemctl start nfs-server
sudo systemctl enable nfs-server

Step 6: Export the Shared Directory

Run the following command to export the shared directory:

sudo exportfs -a

Step 7: Configure Firewall

Allow NFS traffic through the firewall:

sudo firewall-cmd --add-service=nfs --permanent
sudo firewall-cmd --add-service=mountd --permanent
sudo firewall-cmd --add-service=rpc-bind --permanent
sudo firewall-cmd --reload

Step 8: Set Up NFS Client

On the client machine, install the NFS utilities:

sudo dnf install nfs-utils -y

Step 9: Create a Mount Point on the Client

Create a directory where the NFS share will be mounted:

Key topics covered in Setting Up an NFS Server and Client on CentOS 9
Key topics covered in this NetCloud24 guide.
sudo mkdir -p /mnt/nfs_client

Step 10: Mount the NFS Share

Mount the NFS share on the client:

sudo mount -t nfs server_ip:/mnt/nfs_share /mnt/nfs_client

Replace server_ip with the actual IP address of your NFS server.

Step 11: Verify the Mount

Check if the NFS share is mounted correctly:

df -h

Step 12: Automate Mounting at Boot (Optional)

To ensure the NFS share mounts automatically at boot, add the following line to /etc/fstab on the client:

server_ip:/mnt/nfs_share /mnt/nfs_client nfs defaults 0 0

Step 13: Conclusion

You have successfully set up an NFS server and client on CentOS 9. This configuration allows for efficient file sharing across systems, making it ideal for collaboration in environments like a . For additional options, explore various solutions, including Windows VPSVirtual Private Server Hosting and Windows VPS Hosting UK for optimal performance and security.

© 2024 NFS Setup Tutorial. All rights reserved.

Practical checklist for Setting Up an NFS Server and Client on CentOS 9
Practical checklist for applying the guidance in this article.
Setting Up an NFS Server and Client on CentOS 9
Setting Up an NFS Server and Client on CentOS 9
Explore more

More on this topic

Netcloud24
Netcloud24
Cloud Infrastructure Expert · NetCloud24

Comments are closed.