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


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Solved Mount custom volume in app container

    Feature Requests
    nextcloud storage feature-request
    2
    6
    404
    Loading More Posts
    • 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.
    • H
      hendrikvl last edited by girish

      I would like to propose/discsuss the following: How about an option to bind additional Docker volumes for Cloudron apps?

      My usecase is the following: As discussed several times in this forum, the built-in backup options of Cloudron are not so well suited for the rather large data directories of Nextcloud. Therefore, I would like to move the Nextcloud data to another volume (which is not included in the Cloudron backup) and change the nextcloud-config to use that as data directory. I would then take care of backing up that directory on the Cloudron host by myself.

      I currently implemented that behaviour by creating a symlink of the data directory on the host. @tobru mentioned that in this post and asked how to include it in the backup. I explicitly went that way to exclude a folder from the backup. But that seems like misusing an implementational detail of the Cloudron backup, which might change at some point and should not be done on purpose. Thus my question to bind a custom folder as volume in the app-container.

      I know that you plan to implement a per-app choice of tgz/rsync backup-options in one of the upcoming releases. That wouldn't really solve it for me though, as I use the Filesystem backup provider and would end up with an additional copy of my nextcloud data. (I use restic btw, to backup both the Cloudron backup-directory and the nextcloud data folder.)

      H 1 Reply Last reply Reply Quote 2
      • girish
        girish Staff last edited by

        @hendrikvl Yes, agreed. This is in our immediate roadmap. As you said, what is needed is a way to add a volume (which is a directory on the server) and then place this volume in a location of the app's container (essentially, docker's -v flag). This way this volume can be used by the app to store data (like nextcloud's external storage feature). We also had this idea that we can optionally allow this volume to be backed up just like apps. So, it won't be part of the app's backups but volume's backups. Most likely, we won't implement the backup feature as part of the first iteration though.

        Time wise, we are making a new release of Cloudron (https://forum.cloudron.io/topic/2103/what-s-coming-in-4-5) in the coming days. The volume feature is the roadmap for the release after that.

        1 Reply Last reply Reply Quote 1
        • H
          hendrikvl last edited by

          Thanks for the fast response, @girish and cool to hear that you consider to implement it.

          1 Reply Last reply Reply Quote 0
          • H
            hendrikvl @hendrikvl last edited by

            @hendrikvl Just wanted to report that I switched to volumes which are now implemented in Cloudron 6. I have the Nextcloud-config and apps in appsdata and a separate Nextcloud datadirectory mounted through a volume. Cloudron takes care of backing up appsdata and I backup the NC-datadirectory separately. Works like a charm.

            Thanks for implementing that!

            girish 1 Reply Last reply Reply Quote 1
            • girish
              girish Staff @hendrikvl last edited by

              @hendrikvl Do you have any notes/instructions on how you changed the datadirectory ? I think we might have to leave a note in the packaging code not to overwrite data directory to not break your installation!

              H 1 Reply Last reply Reply Quote 0
              • H
                hendrikvl @girish last edited by

                @girish Oops, I realized just now, that I didn't reply to your question yet. What I changed and maybe has to be protected from being accidentally overwritten is the 'datadirectory' option in /app/data/config/config.php. I changed that path from the default path to '/media/mymountpoint'.

                I don't remember if I had Nextcloud in maintenance mode or put the app in recovery mode, while I changed that path and moved the files. But it was either of them. However, I had some duplicate storage paths in the database afterwards and I manually updated the oc_storages table as described here and did a files:scan afterwards. But that should not be related to what the code for updates overwrites, I guess.

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                Powered by NodeBB