How to build a home file server (NAS) with Openmediavault
Network-attached storage (NAS) is useful on a home network to store photos, backups, or other files.
Openmediavault is a free open-source NAS platform based on the Debian distribution of Linux. It’s a robust and lightweight platform that’s easy to install on low-powered (old) PC hardware — a perfect use for an older desktop PC.
In this post, I’ll go through the steps to install Openmediavault and configure file sharing for your home network.
Step 1: Prepare the host PC.
Most old PCs will work just fine for Openmediavault, even an old laptop. Here’s a short list of requirements and initial configurations that I look for when preparing a host:
- Network port. Please use a physical network cable instead of relying on a slower and less reliable wireless connection.
- Static IP address. Determine what the IP address will be — this should be an available address on your network that’s outside of the DHCP assignment range configured on your router. This will be the address used to access file shares and the admin control panel.
- Hard drives. You’ll want at least two hard drives — one small one for the OS and a larger one for network shares. Ideally you’d have a third to use for backups of the main drive. You can always add more or bigger hard drives later if needed (assuming you have ports and internal space to do so).
- RAM. Openmediavault has very low RAM requirements, so anything with 1–2GB or RAM or more will work fine.
- Configure the PC BIOS to power on automatically to last power state. This way if power gets interrupted it will automatically start up when power is restored.
- If using a laptop, configure it to stay on indefinitely with the lid closed. Store the laptop upside-down or where it has plenty of ventilation.
Step 2: Install Openmediavault
Download the most recent version from https://www.openmediavault.org/, copy the ISO file to a bootable USB drive or CD, then boot from this image and follow the installation prompts to install. You can mostly go with the defaults except for setting the IP address, timezone, etc.
Step 3: Connect to Openmediavault
Browse to the IP address and enter the default credentials (admin, openmediavault) to access the admin panel. The home page will look something like this.
Step 4: Configure Openmediavault
Using the menu sidebar, click into each link top-to-bottom, starting with General Settings. I’ll go through the key settings below — the others can be skipped unless you want to change something from default.
General Settings: Set Auto logout to Disabled, and change the web administrator password to something memorable.
Disks: Check to make sure all hard drives are showing up. If you are starting with an empty NAS, wipe them to delete any pre-existing data or formats. Do not change or wipe the hard drive the OS is installed to (determined during installation).
File Systems: Create file systems on all hard drives. To keep things simple, use ext4 and create one file system per disk, then mount each file system.
Shared Folders: Add shared folders. Grant permissions of Everyone: read/write.
To keep things simple, add one folder per device, named the same as the device. It won’t be referenced until further down in this post.
Click ACL, and check that the Others group under Extra options is set to Read/Write/Execute. Leave everything else as-is.
NFS: Enable the NFS service if needed (for connecting Linux servers, etc). If you don’t know what this is, you probably don’t need it.. skip to the Rsync step.
Add one share per shared folder. Set client to your reflect your network, typically 192.168.1.0/24 for most home routers (.0/24 means you have a router at 192.168.1.n with a subnet mask of 255.255.255.0).
Set privilege to Read/Write. Leave Extra options as-is.
Rsync (optional): Rsync will copy files on a schedule, and is great for automatic backups. To use, add a job and enable. Specify source and destination shared folders.
To set up a daily backup, set a minute and hour. Leave Day of month, Month, and Day of week as *. Leave the Every options to the right off.
The other option to set is whether you want destination files deleted if they don’t exist on source. I’d recommend setting this to Delete unless you plan on manually running the job on a regular basis to purge out unnecessary files on the destination end (renaming a folder will result in two copies, for example). All other settings can be left at their defaults.
Leave the Server tab not enabled.
SMB/CIFS: Enable this service (leave the rest set to defaults).
Add shares, one share per disk.
Under Public, set to Guests allowed. Description of settings:
- No: Users will need to enter credentials to access the share. This is more secure but a major inconvenience for a home network with a few users.
- Guests allowed: Anyone on the home network will be able to access the share without entering credentials, and be able to write files.
- Guests only: Anyone on the home network will be able to access the share without credentials, but access will be read-only.
Step 5: Connect to the NAS
To access shared folders on a PC, type your NAS address (\\192.168.1.2 in example below) into the Explorer address bar and hit Enter.
To add a shortcut to a shared folder in Windows 10, right-click on Quick access and click Pin current folder to Quick Access.
That’s it — enjoy!
Notes from the author
I’ve used Openmediavault for many years on old PC hardware, have migrated disks to new hardware and upgraded versions with no issues, and Openmediavault continues to deliver rock-solid performance with no ongoing maintenance necessary. The NAS is only rebooted once or twice a year (always due to power outages or moves, never due to Openmediavault performance).
Openmediavault supports a wide range of additional services such as Docker support, Plex media server, etc. Since the NAS is a core component of my home infrastructure, my preference is to keep the NAS lightweight and unencumbered with other services for three main reasons:
- Interruptions and maintenance should be minimal in order to maintain uptime and reliability. Adding other packages, services, and complexity increases the likelihood the NAS will be unavailable due to breakage within these plugins.
- The one job of a NAS is to not lose my files. If something happens to hardware (power supply, motherboard, etc), I want to be able to easily move the hard drives into a new PC, install Openmediavault and be back up and running in little time (I’ve successfully tested this during a build on a less-old PC). A complex installation with many custom configurations could be harder to restore and, as a result, could compromise my files.
- By splitting infrastructure services into different hardware or VMs, issues are isolated if and when they occur.
I realize there is a real case for plugins, RAID, and more complexity and configuration. The goal of this post (and most of my projects) is to get up and running quickly with minimal complexity, and to create a core service that is secure and reliable with minimal maintenance needs.