Nextcloud - External Storage as Local (Windows)

Hi all,

So there is a Windows machine, Nextcloud installed within Docker (along with Mariadb). External storage is installed and my question is, “Local”, how do I add a folder that is “outside” docker? (so not like volume or similar…or is it even possible otherwise?).


So, I want to attach and mount the “nextcloud_data” folder (so E:\nextcloud_data) on drive E of the Windows machine. What should I write in the configuration?
Do I have to add it as a volume anyway? (if so, what is the exact course of this?)

I use Portainer within Docker (!).

Also, there is an option that when installing Nextcloud ($ docker run -d -p 8080:80 nextcloud )
do i write it to use the data folder mentioned above?
Something like -v mnt/ (bla bla) :slight_smile:

Thanks in advance for the help!

Yes, Docker containers do not have access to anything on the underlying host unless it’s mounted as a volume or bind mount into the container.

Also, there is an option that when installing Nextcloud ($ docker run -d -p 8080:80 nextcloud )
do i write it to use the data folder mentioned above?
Something like -v mnt/ (bla bla) :slight_smile:

If you’re running Docker services entirely from the command line, yes, you can use -v:

1 Like

Maybe if someone could help me and write to me that:

  1. If for an existing Nextcloud container, what should be written for the volume?
    ( data path still: E:\nextcloud_data )
    volume1.jpg (1007×673) (

  2. Also, if I were to install the nextcloud container, what path should I enter for the volume? ( data path still the same…E drive )
    volume2.jpg (993×841) (

  3. It is not entirely clear, but I think that if I use mariadb, the volume should not be set in the nextcloud container, but in the mardiadb container. What to do in this case?

( Sorry if I’m asking some basic things, but I’m still learning this system. )

Again…thanks in advance for the help!

“It’s best access files stored in Nextcloud through official interface e.g. WebDAV so the application can keep track of changes and offer functions like trashbin and versions. If you temper with Nextcloud’s storage the system might behave unexpected and data loss might occur.

So instead of choosing Local as external storage, is it safer to use Webdav? (or maybe add the folder via SFTP/FTP?)

no you can perfectly add “local external storage” but you must no access internal Nextcloud storage from outside of the application e.g. change the data using host OS.

you can mount your Nextcloud as WebDAV - it has it’s own problems expecially with Windows but in theory it looks like local storage.

Based on your screenshot, name is the path you want to volume to appear at within the container. And the value field is the path to the native volume/file path on the underlying host, but you’d have to check the portainer documentation and possibly the Docker Desktop docs.

I haven’t ran Docker on Windows in awhile nor do I use a GUI like Portainer so unfortunately I can’t tell you how the Windows drive paths play into things. IIRC Docker Desktop runs Docker in a VM so the Windows style paths are already converted into something resembling Unix-style paths. Your life is a little complicated because you’ve got multiple layers of abstraction going on here (Windows → Docker → Portainer → Container).

I presume you’d select the volume there and specify the path within the container you’d like it to appear at.

Are you referring to the nextcloud_data folder you’re trying to mount? Or do you mean in general? The MariaDB container needs its own data volume for storing the database, but it’s unrelated to any data files you use for file storage by Nextcloud itself/the Nextcloud app container.

I just mean that the said folder “nextcloud_data” should be added inside nextcloud (docker) or inside mariadb as a volume? After which I can mount the folder within Nextcloud (external storage - Local ).

I just want to clarify this, since I asked for help on another forum:

The “nextcloud_data” folder is not the data that nextcloud would use by default, but it is a mounted folder that I would like to use to store only images, videos, etc.! ( like I attach this folder in sftp or webdav to nextcloud )

Inside the Nextcloud Docker container.

Okay, thanks for the help! (very much)
I’ll have time to deal with it today or tomorrow, so I’ll let you know what I’ve come up with.

1 Like