Nextcloud and local filesystem as Volumes
-
I want to use Nextcloud, but also make teh files I upload to it accessible to other apps on the Cloudron, and just in general. I don't want to have to upload to the Nextcloud folder inside the Docker container.
So I made a new directory at /srv/cloudron, chown'ed it to so that the owner and group are www-data, added it to Cloudron as a Volume of Type filesystem, and then added it as a Mount under Storage in the Nextcloud Cloudron dashboard.
I then activated the External Storage plugin... but it won't be added. Judging from the Logs, Nextcloud is looking for /srv/cloudron INSIDE the container, and not the VPS itself. So the question is...
How do I get Nextcloud to recognize the local filesystem Volume?? Do I need to make a ln -s from /srv/cloudron to the container???
Thanks!
NOTE: When I added /srv/cloudron as a Volume I chose simply Filesystem, not Filesystem (Mountpoint).
NOTE 2: I just tried redoing it using Filesystem (Mountpoint) and Nextcloud still can't load it, just a red arrow.
NOTE 3: I also tried changing the directory, /media/cloudron, but no luck.Figures. Nextcloud. What a headache.
-
I used the NextCloud "internal" functionality to mount the local path as another available space. Maybe that helps in your case?
-
Thanks @Kubernetes . I tried googling that but didn't come up with enough.
I did find this line, "Mounting an existing server directory as 'external storage' on Nextcloud is currently not supported." at https://docs.cloudron.io/apps/nextcloud/. Looks like what I'm trying to do, at least the way I'm trying to do it, doesn't work.
-
I think @avatar1024 mentioned he'd done this, no? so perhaps we just ask him to share how he's got it set-up?
But, without investigating myself, I'd guess:
- Create a Volume as per https://docs.cloudron.io/volumes/
- Mount it into Nextcloud as per https://docs.cloudron.io/apps/#mounts
I think maybe that's it?
-
Yes, Cloudron itself "works", but when I try to add the filesystem location using the External plugin within Nextcloud, I get this error from the Cloudron Logs window for the Nextcloud app:
[no timestamp] storage path does not exist \"/srv/cloudron/\"","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36","version":"28.0.4.1","exception":{"Exception":"OCP\\Files\\StorageNotAvailableException","Message":"Local storage path does not exist \"/srv/cloudron/\"","Code":1,"Trace":[{"file":"/app/data/apps/files_external/lib/MountConfig.php","line":128,"function":"__construct","class":"OC\\Files\\Storage\\Local","type":"->"},{"file":"/app/data/apps/files_external/lib/Controller/StoragesController.php","line":246,"function":"getBackendStatus","class":"OCA\\Files_External\\MountConfig","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/app/data/apps/files_external/lib/Controller/GlobalStoragesController.php","line":201,"function":"updateStorageStatus","class":"OCA\\Files_External\\Controller\\StoragesController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/app/code/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"update","class":"OCA\\Files_External\\Controller\\GlobalStoragesController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/app/code/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/app/code/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/app/code/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/app/code/lib/base.php","line":1069,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/app/code/index.php","line":39,"function":"handleRequest","class":"OC","type":"::"}],"File":"/app/code/lib/private/Files/Storage/Local.php","Line":106,"Hint":"Storage is temporarily not available","message":"Local storage path does not exist \"/srv/cloudron/\"","exception":{},"CustomMessage":"Local storage path does not exist \"/srv/cloudron/\""}}
So, Cloudron can add it and open it and use it. Just somehow Nextcloud isn't seeing it. I am thinking it has to do with Docker... Nextcloud's data directory is not / anything, since it is in a container, and for some reason it can't see outside of the container to recognize the "real" /. There must be some naming convention trick I'm missing.
And of course googling any combo of these terms gives either no or no-related results, or so many that seem related but aren't.
-
Did you add it here:
The screenshot is the setting page of my Nextcloud app in Cloudron.Then for me the volumes appeared automatically in Nextcloud > Administration settings > External Storage (I don't think I even had to install install plugin, apps or anything)
-
@avatar1024 said in Nextcloud and local filesystem as Volumes:
I don't think I even had to install install plugin, apps or anything
I think you must've as there is no External Storage menu option without installing anything.
@scooke out of interest I just mounted the Music volume I use for Navidrome into one of my Nextclouds:
Then I installed the
External storage support
app in NextcloudThen in
/settings/admin/externalstorages
in my Nextcloud I added the volume (choosing 'Local' from the drop down and then/media/{volume name}
ie in my case I just wrote/media/New Music Volume
in the Configuration box)Then when I went to my Nextcloud files I saw this new folder:
And this this in the side bar on the left:
And looking in Local (or via External storage -> Local) I saw a folder called Music
And all my music is there (it took a while to load the first time and there are A LOT of files in there), but it all Just Worked
-
@scooke the
/srv/cloudron
is the host path. The path inside the container will be/media/<name-of-cloudron-volume
. So , when you add the storage inside nextcloud, you should put/media/<name-of-cloudron-volume
. -
@scooke said in Nextcloud and local filesystem as Volumes:
I want to use Nextcloud, but also make teh files I upload to it accessible to other apps on the Cloudron, and just in general. I don't want to have to upload to the Nextcloud folder inside the Docker container.
Maybe this helps, but off my head (and my nextcloud information could be outdated, please double check), you need to be aware of some pitfalls:
-
Nextcloud stores files by default in one place. Let's call this "primary storage". If you want to change that in Cloudron , you have to use https://docs.cloudron.io/apps/#data-directory (and not the mounts feature).
-
If you want nextcloud to store files via 'external storage' feature of nextcloud, you have to use https://docs.cloudron.io/apps/#mounts
-
If an external app uploads a file to "primary storage", nextcloud won't see it. One has to run that occ scan command manually. In contrast, if an app uploads to "external storage" , nextcloud will see it immediately.
-
Features like instant upload (i.e automatically uploading photos via mobile apps) will only work with 'primary storage' .
-
'External storage' is shared via groups iirc. And really it behaves very differently from the files in 'primary storage'. You have to play around and see if it suits your workflow.
-
-
@girish This worked. What I didn't understand was that /media/name_of_volume was a hard and fast location. The documentation had this line,
As a security measure, only host paths under /mnt, /media, /srv and /opt are allowed.
which I took to mean that if I used any of those four + the volume name, that that was the location for the Configuration option in Nextcloud. So presumably I could still make any Volume using any of those four, but in Nextcloud the Configuration will always be /media/name_of_volume? Even though it is "now" clearly obvious in the Cloudron Nextcloud dashboard, thatApps can access mounted volumes via /media/{volume name} directory. This data is not included in the app's backup.
I thought that the "/media" directory was there as an example, and that any of those four might be used, depending on how the Volume was added. But no, right there, clear as day, it says to use /media.For someone like myself that just isn't clear and obvious. In this screenshot of adding a Volume, would it be helpful to add a line like, "These filesystem Volumes will then be accessible only at /media/name_of_volume." ? Or are there too many variables; other apps would need this specificity?
Or perhaps in the image shared above:
Use the directory /media/{volume name}, regardless of its host path, as the path for Apps that will access mounted volumes. This data is not included in the app's backup.
I don't know.... now that I understand /media is how Cloudron manages Volumes, at least filesystem Volumes, it kind of makes sense. Thank you everyone for pitching in. The Volume did load and I can see the contents. Phew.