1. Home
  2. Linux

How to set up an NFS share in Webmin on Ubuntu Server

NFS (AKA Network File System) is a handy networking tool that makes transferring files on Linux super fast. However, setting it up is tedious if you do not know what you are doing.

That’s where Webmin comes in. It’s a web UI manager for UNIX-like operating systems that makes setting up complex things like NFS easy. In this guide, we’ll show you how you can set up an NFS share with it.

Set up Webmin on Ubuntu Server

Before you can use Webmin on your Ubuntu Server to set up NFS shares, you’ll need to set up Webmin on your Ubuntu Server. To set up Webmin on your Ubuntu system, you’ll have to download and install the latest DEB package to your computer.

To download the latest release of Webmin for Ubuntu, click on this link and head over to the official Webmin website. Once there, find the “Debian Package” button and select it with the mouse to begin the download.

Once the DEB package is downloaded, transfer the DEB package to your Ubuntu server over SSH. When the DEB package is transferred over to the Ubuntu system, install it. Then, go to your computer, open up a web browser and follow the link below to open the Webmin web UI.

http://YOUR_UBUNTU_SERVER_IP_OR_HOSTNAME:10000

Root password for Webmin

To access the Webmin web UI on the Ubuntu Server, you must have access to the root account and know the root password. Unfortunately, on Ubuntu, this isn’t as easy, as the root password is shut off for security purposes.

To change the root password for Ubuntu, do the following. First, log into the Ubuntu Server over SSH. Or, sit at the TTY console. Once at the console, use sudo -s command to gain root access to Ubuntu Server.

sudo -s

Now that you’ve gained root access make use of the passwd command to change the root password in Ubuntu. Be sure that this password is memorable and secure.

passwd

Install NFS packages on Ubuntu Server

With Webmin installed and the root password configured, you’ll need to install NFS packages on Ubuntu Server. Without these packages, Webmin will not be able to configure your NFS shares through the web UI.

To install the NFS packages on the Ubuntu system, open up a terminal window and log in over SSH. Or, sit at the server and interact with the command-line using the TTY console.

Use the following apt install command to set up the latest NFS server package with terminal access.

sudo apt install nfs-kernel-server

After writing the apt install command above, Ubuntu will ask for your password. Using your keyboard, type in your username’s password. When you’ve entered your password, Ubuntu will collect all packages to install. Then, it will ask you to press the Y button to confirm you’d like to install the packages. Do so to continue.

How to set up an NFS share in Webmin

To set up an NFS share in Webmin, start by logging into the Webmin web UI interface in a web browser. Once you are logged in, locate the “Refresh Modules” button, and click on it with the mouse.

After refreshing modules, follow the step-by-step instructions below to configure your NFS shares in Webmin.

Step 1: On the Webmin sidebar, click on the “Networking” section with the mouse to expand the menu items. Then, look through the “Networking” area for “NFS Exports” and click on it with the mouse.

Step 2: Inside the “NFS Exports” area, find the “Add a new export” button and click on it with the mouse to create a new NFS export.

When you click on the “Add a new export” button with the mouse, the “Export Details” window will appear. Find the “Directory to export” area, and select the icon next to the text box.

Step 3: Upon clicking on the icon next to “Directory to export,” browse for the folder you wish to share via NFS. Then, locate the “Read-only” section, and click “No.” If you do not select “No,” your NFS share will not be writable.

Step 4: After changing the write settings, go through the other settings and customize your NFS share as you see fit. When you’ve finished customizing everything, click on the green “Create” button to create your new share.

Then, click on the “Return to exports” list to return to the NFS shares list in Webmin.

Step 5: Click on the “Apply Changes” in the NFS shares list to apply the changes to your new NFS share. When you select this button, you’ll be able to access your share over the network.

Mounting a share

Unsure about how to mount your new NFS share on Linux? Enter the following command below in a terminal window.

sudo mount YOUR_WEBMIN_LINUX_SERVER_IP_OR_HOSTNAME:/location/of/nfs/export/ /local/location/to/mount/share/

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.