I am new to NextCloud and fairly new to TrueNAS Scale too. I tried using the NextCloud container method to host NC directly in TrueNAS Scale but couldn’t get it to work for various reasons which I can no longer recall. So I decided to create a VM for NextCloud instead with the intention of then making it use the NAS for the DataDirectory over NFS (V4).
I installed NC using snap. I changed the autoconfig.php to point to the NFS mount point before trying to configure NextCloud. I verified that I can create and read files both as root and as www-data from the NextCloud VM using the shell. But when I try to configure NextCloud through the browser it comes back with an internal server error and the logs says it does not have permissions on the DataDirectory or that it can’t find files in there.
I have been trying to find information about this on the web, but I have yet to find anything that solves the issue. I have played with the maproot and mapuser options on TrueNAS Scale. I have used chown -R root:root on the mount point with chmod 770 as well. I have also tried chown -R www-data:www-data -R.
I cannot find a way to do this. Can anyone tell me please what the answer is?
Snap Nextcloud can only access /mnt or /media locations as it’s external access…
Ensure to mount your external shared storage in any of those two locations of your Guest OS (Ubuntu is preferred) where snap Nextcloud is installed.
Run following command to enable external storage access of snap Nextcloud since by default it’s not enabled…
sudo snap connect nextcloud:removable-media
You only need to change data directory location value in the config file… Nothing else needs changeing.
& Don’t forget to move the existing data directory & it’s content to your new external storage location before rebooting the server & starting nextcloud from new location
Ah! I saw that page and thought I had followed the instructions, but it looks like I missed the very first bit. Will look into this.
If I don’t use snap and install it some other way then I can avoid this problem, is that right? I am confused about which of the installation methods is the most “fundamental” and would not need to follow these instructions. Is the AIO method?
The snap connect nextcloud:removable-media command was what fixed it. I asked the question about installation methods because I don’t the limitations of each of the installation methods, and certainly I didn’t see anything in the documentation that said that the snap method needed this command. My knowledge of these technologies is still basic though, so maybe in time I will get a more intuitive understanding.
I did try deploying inside TrueNAS Scale but I hit various issues. Mainly the installation fails the security checks on the admin pages and I couldn’t work out how to fix them. I couldn’t understand how to get it to use TLS, although with some study I think I might have been able to solve that one. But then I couldn’t work out how to make it use a different data directory outside the www path. I think I might have a better chance if I tried again now that I know what I know. However, I thought I also saw something somewhere that suggested that the container technology in TrueNAS Scale may be about to change, so in the end a “nearer the metal” solution seemed better.