If you’ve got an Ubuntu machine that you’d like to use as a Network Attached Storage (NAS) server, Cockpit makes it easy to do. Cockpit is a web-based server management tool that lets you manage multiple servers from one dashboard. In its latest version, Cockpit comes with a File Sharing feature that turns Ubuntu into a NAS server in just five easy steps.
Install required packages
Open the terminal and enter this command to install the necessary packages:
sudo apt-get install samba samba-common smbclient samba-dsdb-modules
Install Cockpit
Enter this command to install Cockpit:
sudo apt-get install cockpit
The Cockpit ZFS Manager plugin is a community-developed extension that integrates ZFS management into the Cockpit interface. To install the plugin, follow these steps:
- Open a terminal on your Linux server and update the package lists:
sudo apt update
- Install the plugin using the package manager:
sudo apt install cockpit-zfs-manager
- Restart the Cockpit service:
sudo systemctl restart cockpit
Access ZFS Manager in Cockpit
- Open your preferred web browser and navigate to your Cockpit server’s URL:
https://<your-server-ip>:9090
- Log in using your server’s credentials.
- Once logged in, you will see the “ZFS Manager” tab on the left side of the interface. Click on it to access the ZFS management features.
Manage ZFS Pools
The ZFS Manager plugin allows you to create, monitor, and manage ZFS storage pools. You can perform various operations, such as creating a new pool, adding disks, and checking pool status.
- To create a new pool, click on the “Create Pool” button at the top of the ZFS Manager page.
- Provide a name for the new pool, select the disk(s) to be included in the pool, and choose the desired RAID level.
- Click “Create” to create the new ZFS pool.
Manage ZFS File Systems and Snapshots
The ZFS Manager plugin also enables you to manage file systems and snapshots within the ZFS pools.
- Navigate to the “File Systems” tab under the ZFS Manager page.
- To create a new file system, click on the “Create File System” button, provide a name, and click “Create.”
- To create a snapshot of a file system, select the desired file system and click the “Create Snapshot” button. Provide a name for the snapshot and click “Create.”
Monitor ZFS Pool Health and Performance
The ZFS Manager plugin provides a comprehensive overview of your ZFS pool’s health and performance, including:
- Space usage: View the total, allocated, and free space in your ZFS pool.
- Pool status: Monitor the overall health of your ZFS pool, including any potential issues or errors.
- Disk utilization: Track the individual disk usage within the ZFS pool.
Enable the file sharing
- Open Cockpit by entering your IP address followed by port number 9090 in your web browser (e.g., http://your-ip:9090/)
- Login with your username and password
- Click on “File Sharing” in the sidebar menu
- Click on the “Enable File Sharing” button
- Choose a directory to share and click “Save”
- Adjust the permissions as needed
Set up a user account
- In Cockpit, go to the “Users” section
- Click on the “Add User” button
- Fill in the required fields, including login and password
- Click “Create User”
Access the NAS from another device
- In Cockpit, go to the “Overview” section
- Note the IP address below the server name
- On your client device, open the file explorer and enter the IP address in the address bar
- You will be prompted for a username and password. Enter the credentials from Step 4.
- You should now be able to access your shared directory, and your Ubuntu machine has been transformed into a NAS.
Working in IT for more than 15 years now, I’ve ran into and solved problems that are very specific to network and system administration.
I have implemented my expertise in designing, developing and executing technical solutions that have passed the test of time, managing simple and complex systems, and administrating networks.