My 10 year old NAS finally died after 10 years. It ran Ubuntu, with a bunch of apps and services installed via the OS’s package manager, and some installed and compiled from source. I used the LTS version of Ubuntu for longer term support, and I actually did full OS upgrades once or twice. However, I think I stopped since version 16 or so. I remember after doing full upgrades, certain apps or setup would break (packages removed, dependencies removed or are no longer compatible, etc.).
For my new NAS, I thought about buying a fully built NAS from Synology based on this article from Linux Journal. Although having a pre-built product seems very tempting, I just couldn’t justify the added premium, knowing that I was technical enough to install a Linux OS, that there are distro’s like OpenMediaVault (OMV) that is highly stable and user-friendly, and that Docker is also used to install apps in Synology’s products.
For my new NAS, I bought a 4-bay server from U-NAS because I wanted a small footprint, low power consumption, and the ability to add and remove drives easily. The U-NAS chassis is similar to my old Acer NAS. I went with OpenMediaVault because it was designed to be user-friendly and because I don’t need ZFS (used for FreeNAS).
I wanted to document my setup in case I needed to re-do this in the future for other servers. I followed this guide and this guide to install and setup my server. Here are some things that I want to document.
First, after I installed the OS, I received the following error message when the server booted up:
mdadm: no arrays found in config file or automatically. Apparently, this happens when because I installed the OS on an SSD and then I added additional HDD’s. This post suggess a fix: with only the SSD, boot up the server, plug in the HDD, log in as root, execute
update-grub, and restart the server.
- After the OS is installed, visit the server’s IP address to reach the OMV’s web console. Change the default password.
- Since it is a NAS, I installed multiple hard drives for data storage on top of the OS drive. Assuming the drives have been formatted as something like an
ext4format, the drives should be mounted by default in
- Create shared folders under Access Rights Management > Shared Folders. I created one called
home, and one called
share. The former is used to store the home directories of the users (I prefer to have this enabled for users with ssh access). The latter is used to store my media files to be shared across the network.
- Create users under Access Rights Management > User
- At least one user belonging to the following groups (my admin account via ssh): users, ssh, sudo, and root.
- At least one generic user used to access files from the TV or other media devices (eg,
mediauser), belonging to the following group: users.
- Turn on SSH and SMB/CIFS services under Services.
- I was able to install omv-extras by running the following in the terminal:
wget -O - https://github.com/OpenMediaVault-Plugin-Developers/installScript/raw/master/install | sudo bash
- In the web console, I can now install Docker and Portainer under System > OMV-Extras > Docker.
- One can log onto Portainer’s web console with
server_ip:9000. Set up the admin password.
- Here is an example of how to install a Docker app using Portainer, with Heimdall as the example. Since we’ll be installing various apps and services as in self-contained Docker containers, we’ll have to manage many of them via their own web consoles (different ports); Heimdall bookmarks all the URL’s so we have a landing page that itemizes all the apps for easier navigation. I will show how to enter the critical information from the Docker Hub page. Compare the values from that page and what’s entered here.
- In Portainer, go to the Container page. Click Add container.
- Registry: leave as
- Image: paste in
- Manual network port publishing: add 2 ports (
portsdescription under the docker-compose schema)
- 80 -> 8888 (80 goes to OMV by default)
- 443 -> 8889
- Under Advanced container settings > Volumes, map the following container -> volume paths (
volumesdescription under the docker-compose schema)
/appdataon the OS hard drive, as the config folder for all Docker apps will be stored here using the layout
- Under Advanced container settings > Env, enter the following environment variables (
environmentdescription under the docker-compose schema)
1000(for the primary user set up in step 4, type the following in the web console to get the user id:
id -u username)
100(for the primary user set up in step 4, type the following in the web console to get the user id:
id -g username)
- Under Advanced container settings > Restart policy, select
- Click Deploy the container to have the app started.
server_ip:8888to get to the Heimdall page
- Additional Docker apps could be installed in a similar fashion as the previous step. Note that some apps will also have a
/downloadsfolder, so map them accordingly. Some apps also require the following Docker option
--cap-add=NET_ADMIN; this is set under Advanced container settings > Capabilities.
I think my new NAS should last me at least 10 years.