Help me to make NC put files on my other windows volume

welcome, first of all, i hope tags for this topic are correct.

i have my NC running on Docker using Portainer stack.
everything is working, i can connect and upload/download stuff through my domain and such.
BUT
Why is it so hard to point nextcloud to put ALL the files on my additional drives i bought JUST for this?
ALL internet videos/posts show some terminal black magic that doesn’t point me anywhere.
people type only stuff like “oh just use this commad and ure done” “worked thanks!”
meanwhile my dumbass sitting here asking WHERE, HOW.

so please i need a tutorial for dummies on how to make nextcloud put stuff on my D drive and not C (main system drive).

You have to change the data directory inside your config.php. For us Linux users we just change the data directory to some mountpoint which already exists - for example
'datadirectory' => '/var/www/html/nextcloud/data',

or
'datadirectory' => '/mnt/nextcloud/data',

I asume for Windows it would be something like
'datadirectory' => 'd:\nextcloud\data',

Perhaps you have to add a trailing slash and maybe you have to use backslashes (\) instead of slashes (/) - but thats windows specific. Perhaps both works - haven’t worked for years with a windows based webserver

PS - if you use backslashes (\) you perhaps have to also escape those with a backslash

‘datadirectory’ => ‘d:\\nextcloud\\data’,

@SnowNXT you are not giving us much info to help you.

I assume you are talking about data stored on the client and not the server itself?
If so, and if you are using NC desktop Client, you can simply change the folder where your files are stored.
Client installation guide explains this quite well.

On the local folder options screen, you may sync all of your files on the Nextcloud server, or select individual folders. The default local sync folder is Nextcloud, in your home directory. You may change this as well.

You can remove your current user from the client config and add it again with new location for file storage.

Be careful when changing the datadirectory: Is there a safe and reliable way to move data directory out of web root? / HowTo: Change / Move data directory after installation

@SnowNXT The exact solution depends very much on the system and how it was set up. So before we can provide you a working answer, you have to explain your system in more detail.

If you would fill out the support post template, it would help a lot… It’s there for this reason.

Just reading the other replies, we can’t even tell if you’re talking about the server or client.

@KarlF12
Hello, you’re right.
but at the same time its hard for me to answer half of the points.

and i think im talking about the server. i installed it on my docker via portainer to install my own nextcloud.

@dzidek23
thank you for your input but that doesnt look like what im dealing with.
its on a website and not like an app or something.
unless im doing it wrong? will the app change the storage?

to ADD to the topic.
i followed the installation of nextcloud of this video:
https://youtu.be/Wj0SsbRbCNo?list=LL
dont look at other stuff in it.

EDIT: I’m willing to re;install the entire Nextcloud container if it means setting up storage on OTHER drives than the main one.

Well… be that as it may, we don’t know anything about your system, so if you can’t tell us how it’s set up, we sure don’t know.

I guess you have this Portainer thing installed in Windows? I’m not familiar with it. If you’re using the Docker version of Nextcloud, then it’s at the mercy of wherever your OS (or Portainer) stores the container data. Nextcloud doesn’t know anything about this. It thinks it’s on a Debian system because that’s what’s in the container with it.

I know there are some others here who use Portainer, so maybe they can jump in.

its just simple Windows 10,
2 volumes.
C:\ with OS and all the software installed on it.
D:\ is literally empty because i want my Nextcloud to put all its storage in there :frowning:

I have Docker Desktop, then i ran powershell command to install portainer.io that gives a nice UI on website to manage Docker.
Then as i linked previously i install Nextcloud like shown in video. not sure why bring up cloudflare since its just a proxy and im only concerned with pointing NC to the correct drive
(its all on 1 machine i only use cloudflare+domain to make it semi-public).

im not sure what else can i say. thats all the information i know. what else do i need to specify?
or is Portainer/Docker so unpopular here? Youtube for sure is flooded with it, but no1 is talking about this specific issue :frowning:

Docker is very popular with Nextcloud. I maintain two servers myself and both use it. But I don’t use Portainer or host it on Windows. I could tell you how to move the storage location on Linux, but I’ve never used Docker for Windows.

On Linux it would be a simple matter of mounting the container’s data directory in a different place. Maybe you can do the same thing in your setup, but I don’t know the exact steps. Here is the official documentation on the subject. https://github.com/nextcloud/docker#persistent-data

You may have to refer to Docker for Windows documentation for specifics for your setup.

1 Like

Because almost no one is using Docker Desktop to run their Linux Server stack and even less people are using Windows to do so. Windows adds just another layer of complexity. If you absolutely have to run Nextcloud on your desktop PC, it would be much easier to manually spin up a Linux VM in e.g. HyperV, and then install Docker in that VM, instead of using Docker Desktop.

Although it would be even better to buy a separate box and use that as a server. This box could be something like a Raspberry Pi or if your budget is a little higher, I would recommend something like a 1L PC from Dell, Lenovo, or HP. These can also be found used, for relatively cheap.

The file system is very different on Windows compared to Linux. As it MAY work, it is surely not officially supported.
Spinning this up with the official Nextcloud Docker container under windows, is definately not supported, as the docker is build with Linux filesystem in mind.

As others has pointed out, you are better of with the official AIO nextcloud VM instead, as that will also provide a native filesystem inside the VM.
EDIT: If using WSL2, you are in fact creating a seperate filesystem, but only as a Hyper-V disk image. So I take it back, somewhat. Using WSL2 you can run the NC Docker. However you gains excactly no advantage compared to do this excact same thing in a VM, or even using the official NC AIO VM.

1 Like

I’m not an expert, but according to the documentation of Docker Desktop, it uses either WSL2 or HyperV to run Linux images on Windows. So @SnowNXT has probably to move the hole VM image which was created by Docker Desktop to the other Disk. Or if Docker Desktop can somehow mount the Windows file system directly into the WSL environment / HyperV VM, these mount points probably just need to be changed. But that’s exactly what I meant, when I said “adding another layer of complexity”. With Docker Desktop on Windows, you’re putting the cart before the horse and have to learn not only Linux and Docker, but also all the ins and outs of Docker Desktop, WSL and Hyper V on Windows.

This! …and preferably on a separate box. :wink:

Im starting to think we might not be able to solve my issue in current form i have it now.
But… last night i was digging for many hours and found this from Portainer.io themselves.
https://youtu.be/vSYqhfYTpeU
showing how you can mount a windows files system as a volume.
uninstalled my docker desktop and installed it again but this time with HyperV.
I tested it with Busybox just like in the demo and linux console in busybox was able to read sample text file i created in there.

Issue started when i tried forcing this mount commands on Nextcloud “/data” path.
it DID deploy the container, info shows ‘/home_mnt/d/Nextcloud’ correctly.
but in reality nothing is being pumped there so again. dead end.

So my last question would be. how would someone do it diferently, even from scratch.
im not gonna install Linux as a default boot system so Windows is a Must.
the rest tho, im willing to change enviroments and such.
there is no way that programs are so stupid to not be able to just goddamn move file to a diferent folder. its a basic function that shouldnt require space rocket science to do.
there must be a solution out there. Guides are preferable instead of linking vague documentations. Docs are rarely usefull to someone not familiar with the system in the first place.
Im gonna check on the topic later if anything pops up if not i might just give up and close it.
i learned a lot in last week starting this website/cloud project with 0 knowledge.

PS: i see some people talking i should have seperate pc. BUT IT IS ON SEPERATE MACHINE.

Well windows is not supported as base OS, so if you are not willing to dable with a VM or Linux yourself, Nextcloud is not for you. The reason is simply put, that the file system under Nextcloud itself runs with a different autorization model, then the filesystem of the mounted path.

A partial solution could be the “external storage” app, but this is a farfetched, bodge tape style approach :slight_smile:

1 Like