TrueNAS Scale Server Build – Application Installation (Nextcloud) – Overclockers Club

TrueNAS Scale – Application Installation:

Installing applications on TrueNAS Scale is, for my purposes, quite easy, and I think that will be the case for most people reading this. The reason I say that is because I lack the aptitude, and to a degree the interest in getting involved enough to go beyond the available catalogs of applications. My limited understanding tells me it is possible to create your own Helm Chart, building a Kubernetes container for whatever application (that can run on the OS) you want, but that is all well beyond me and I am fine with it being there.

When you first install TrueNAS Scale, it will have an official catalog of applications you can install. The installation process is about as easy as it could be, usually taking just a few mouse clicks to do. This is because the catalogs of charts already have reasonable default configurations set, but you are free to make changes. For example, you may want to point the application’s storage to a specific dataset and might be asked to set a password, but I have not encountered anything more involved than examples like those. Or at least I have not encountered anything I feel needs more to be changed, because there are definitely more settings than those involved, and I do not understand a lot of them, hence why the reasonable defaults is valuable.

Before getting too far into installing applications, I want to cover adding new catalogs. While there is the official catalog TrueNAS Scale is already configured to connect to, it is not a very long list of applications. Another I found is called TrueCharts and adding it is quite easy, though its guide does still help with making sure the fields are filled out correctly. Importantly, it does appear to be a reliable and safe catalog, so charts from it should not be a danger to the system or network. All of its charts also support a feature that will come to be useful shortly.

 

As the guide covers, and as can be seen in the screenshot, you must provide a name, a path to its repository, the branch, and Preferred Trains. As this last setting defaults to Stable, and having looked at the TrueCharts catalog, it appears this is to control if you want pre-release versions, experimental versions, etc. but I could be wrong. I would stick with Stable, to be on the safe side.

After the catalog is loaded, the Available Applications list will show you all of the available charts from the catalogs. There is a search to help you find things, which is definitely helpful as these lists can be pretty long. You can then click on the application name for more information, or the Install button to get that process started. Though I am unsure how much I will use it, the example application I am going to use is called Nextcloud. It has a great many features but chances are my purposes would just be as a local cloud storage I can access from my phone. It is available in both the official catalog as well as the TrueCharts catalog. I am installing the TrueCharts version because these charts offer support for something I do wish to cover; NFS sharing.

 

As you can see, there are a LOT of settings here for installing Nextcloud. Fortunately they almost all have reasonable defaults, at least in so far as they are good to leave on their own. I did make some changes, such as reducing the storage quotes from 256 GB, the default for every chart I have seen the option in, to just 8 GB. As this is a storage system that might not seem like much, but this setting can be increased later. In fact, a lot of these settings can be edited after the fact, and I would assume those quotas can be reduced later too, though it is not recommended.

The Nextcloud chart in the official catalog offers far fewer settings than this, which can make it more approachable, but there is also a setting here I want to focus on as it is somewhat important following a recent change to TrueNAS Scale, which I mentioned in a previous section. This change is to prevent applications from using shared datasets as their host storage. There is an option to disable this, “Enable Host Path Safety Checks” under the Advanced Settings for Apps in TrueNAS Scale, but there is another solution I want to share. Unfortunately for one of the applications I wish to use this does not appear to be viable, but we will get to that.

Apparently the purpose behind this setting is to avoid databases for applications from being corrupted due to the dataset being directly shared. Thus the default storage option is PVC, but with TrueCharts’ charts you can add Additional App Storage. This includes adding new host paths but what we are actually going to do is add an NFS share.

I mentioned earlier about SMB shares, which is how you can access files on the server from Windows. An NFS share is what you would use for a Linux or Unix based system, which is what TrueNAS Scale is. By creating an NFS share on the system, you can pass it to an application so it can access it and use it however you wish. Well, almost because there seems to be some configuring you need to do first and while I do not much like some of it, I figured out a way to address my concern.

 

This screenshot shows all of the settings and options available when setting up or editing an NFS share, including the advanced options. In this case it is for a share to a Nextcloud dataset I made. Unfortunately it is not as easy as just hitting Save because, at least for some applications, their permissions might not allow them to do anything to these shares. The way I found to solve this was to exploit the Mapall settings, which indicate that whenever someone or something connects to the share, it should be treated as that user. This is where my concern comes into play, because root would be the most powerful user. Perhaps there is a different user that would work, but my experimentation there was not successful (though I would be very happy if someone could correct me), but there is another setting that can address my concern.

The very last setting is under Hosts, which is not quite the name I would have picked, but once you click the Add button, the longer label is clearer. This allows you to limit the hosts and IP addresses that can connect to this share, treated as root or not. By giving the IP address 127.0.0.1, the local address only the server itself will be allowed to access this share. I would still prefer it if a different user could be used, such as my user, but at least this should be reasonably secure. I did have an issue of not being able to delete some files in a different share because I was not root, but similar setups did not repeat this, so I am unsure of the problem there. (Ultimately my solution was to copy the files elsewhere, delete the dataset, recreate it, and put the files back. Amusingly, I have control over the files in the new dataset despite the configuration being identical.)

 

Here I have focused on just the storage setting for the Nextcloud chart, and as you can see I have added an NFS share pointing to that Nextcloud dataset. To point to an NFS share, you must give the NFS server, which is the local machine so 127.0.0.1, and then the path on the server. Notice it starts with “mnt” as that is necessary. Also the Mount Path value must start with “/”, which is a requirement that confused me for a bit when I was first trying to figure these out. In any case, once Nextcloud is installed and running, it will be able to access that dataset as “/NextCloud.”

Accessing this NFS share within Nextcloud is not too difficult once you get into it. Among the other settings when installing the application is a username and password for an administrator account, which you will use for your first user. Once you are in, you can click on the user icon in the upper right corner of the screen and select Apps. I do not recall if it is one of the already installed, though potentially not enabled, but you want the “External storage support” app active. At this point go to the “External storage” tab under your Administration settings, and make sure it is the one under Administration, not Personal. This is where you will be able to add external storage options that will appear as folder when looking at your files list. You want to add a Local storage, named whatever you want and pointing to “/NextCloud” or whatever the mount path you set earlier.

 

Set that up as SMB storage as well, which is allowed back in TrueNAS Scale, and you can access that dataset from a Windows machine, from the Nextcloud instance on your TrueNAS Scale system, and from the Nextcloud mobile app, if you have that installed and logged in, and on the same network as the server. It is possible to create a VPN to access the server from anywhere on the Internet, but at the moment I do not intend to explore that possibility. I simply do not need such broad access, but I do want to acknowledge that possibility.