Set Up the NFS Server

Follow these steps to install and configure the NFS server on AlmaLinux or Ubuntu:

  1. Run the following commands to install the NFS server.
    AlmaLinux
    CODE
    sudo dnf install nfs-utils
    sudo mkdir -p /mnt/nfs_share
    sudo chown nobody:nobody /mnt/nfs_share
    sudo chmod 777 -R /mnt/nfs_share/
    Ubuntu
    CODE
    sudo apt install nfs-kernel-server
    sudo mkdir -p /mnt/nfs_share
    sudo chown nobody:nogroup /mnt/nfs_share
    sudo chmod 777 -R /mnt/nfs_share/
  2. Configure the NFS exports.
    CODE
    /mnt/nfs_share 10.0.203.0/24(rw,sync,no_subtree_check,no_root_squash)
    /mnt/nfs_share 10.0.202.0/24(rw,sync,no_subtree_check,no_root_squash)
  3. Restart the NFS server:
    CODE
    sudo systemctl restart nfs-server
  4. Verify the NFS server status:
    CODE
    sudo systemctl status nfs-server