Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Nextcloud
  3. Nextcloud and local filesystem as Volumes

Nextcloud and local filesystem as Volumes

Scheduled Pinned Locked Moved Nextcloud
10 Posts 5 Posters 2.7k Views 5 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • scookeS Offline
    scookeS Offline
    scooke
    wrote on last edited by scooke
    #1

    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.

    A life lived in fear is a life half-lived

    girishG 1 Reply Last reply
    0
    • KubernetesK Offline
      KubernetesK Offline
      Kubernetes
      App Dev
      wrote on last edited by
      #2

      I used the NextCloud "internal" functionality to mount the local path as another available space. Maybe that helps in your case?

      1 Reply Last reply
      0
      • scookeS Offline
        scookeS Offline
        scooke
        wrote on last edited by
        #3

        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.

        A life lived in fear is a life half-lived

        1 Reply Last reply
        1
        • jdaviescoatesJ Online
          jdaviescoatesJ Online
          jdaviescoates
          wrote on last edited by jdaviescoates
          #4

          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:

          1. Create a Volume as per https://docs.cloudron.io/volumes/
          2. Mount it into Nextcloud as per https://docs.cloudron.io/apps/#mounts

          I think maybe that's it? 🤷

          I use Cloudron with Gandi & Hetzner

          1 Reply Last reply
          1
          • scookeS Offline
            scookeS Offline
            scooke
            wrote on last edited by scooke
            #5

            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.

            A life lived in fear is a life half-lived

            1 Reply Last reply
            0
            • avatar1024A Offline
              avatar1024A Offline
              avatar1024
              wrote on last edited by avatar1024
              #6

              Did you add it here:
              image.png
              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)

              jdaviescoatesJ 1 Reply Last reply
              1
              • avatar1024A avatar1024

                Did you add it here:
                image.png
                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)

                jdaviescoatesJ Online
                jdaviescoatesJ Online
                jdaviescoates
                wrote on last edited by jdaviescoates
                #7

                @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:

                bc45a64f-fdd6-4abc-ae0a-bb2a71e767d8-image.png

                Then I installed the External storage support app in Nextcloud

                Then 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:

                5039cfb9-d740-415a-9e2e-1662012cc63c-image.png

                And this this in the side bar on the left:

                03020195-fff3-48cf-94b0-02d86a120936-image.png

                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 🙂

                I use Cloudron with Gandi & Hetzner

                1 Reply Last reply
                1
                • girishG Offline
                  girishG Offline
                  girish
                  Staff
                  wrote on last edited by
                  #8

                  @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 .

                  scookeS 1 Reply Last reply
                  2
                  • scookeS scooke

                    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.

                    girishG Offline
                    girishG Offline
                    girish
                    Staff
                    wrote on last edited by
                    #9

                    @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.

                    1 Reply Last reply
                    1
                    • girishG girish

                      @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 .

                      scookeS Offline
                      scookeS Offline
                      scooke
                      wrote on last edited by scooke
                      #10

                      @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, that Apps 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?
                      ae05db42-19c1-4b06-ad4f-621d185c230b-image.png

                      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.

                      A life lived in fear is a life half-lived

                      1 Reply Last reply
                      2
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Bookmarks
                      • Search