Installing Nextcloud with Data on Windows Share

I have gone around and around for a week now, spending nearly every free minute trying to get this to work. I’ve fouled up more virtual machines than I can count - deleted, reinstalled…

I have a windows “server” (old computer) that I have Oracle VM running on. I have installed (about 48 times) Ubuntu, the LAMP stack, SSH, and NextCloud. I cannot for the life of me accomplish something that I know must be possible:

I want the Ubuntu-Nextcloud VM to use a mounted Windows share as the nextcloud/data folder. I want that because I want to be able to simply drag/drop files from other pcs on the network and have those files be visible to any of my nextcloud-connected devices.

I played around with the FSTAB file and got various errors doing that (perhaps incorrectly), I tried using the auto-mount share ability of the VM itself - all eventually arrive at the same point - when I do the NextCloud initial setup and select the share (for example, /media/sf_NextCloudShare/data), it tells me it cannot write to that folder.

I’ve got 3 instances of chrome open with about 20 tabs each and I’m at the end of my rope. I did a search of the forums and was surprised that I couldn’t find a similar question - so I apologize if there are.

Any help is greatly appreciated.

What you’re likely running into are permission issues with the way you’re mounting NTFS in fstab. It’s a bit of a farce.

Tell me, is it a hard requirement that every file be situated on this share? If you were to use the external storage app you could mount the share within the user’s area without trying to make the share the data folder.

I want to thank you for your response.

I’m not sure what you’re asking, though. My ideal situation is that there is some process or mechanism that essentially monitors a folder.

My entire network is windows based, as is the host of the VM running my nextcloud instance. I would like to be able to simply drag/drop files to a regular Windows share (from other Windows PCs on the network) and have them show up automagically in NextCloud. I would also like to be able to drag/copy files from the shared folder that were placed by NextCloud back, if needed, onto other Windows PCs on the network.

I hope that all makes sense.

I did, by the way, succeed in getting the share to mount correctly (I didn’t know you needed to mount with the proper owner/permissions on the mount - I assumed you set those after the mount was created) and I have NextCloud up and running on my server - but with a very clugey workaround: I edited rc.local to add my mount line:
mount -t vboxsf -o umask=0007,gid=33,uid=33 nextcloud-data /var/www/nextcloud-data/

I did that because for the life of me I couldn’t figure out how to make the above line convert to FSTAB.

So - my questions at this point are, is the above line “convertible” to FSTAB? And is there an addin/mechanism that will get NextCloud to basically monitor the data folder and basically add files that are added from a means other than Nextcloud itself?

Again - I really appreciate everybody’s help - I’m new to both NextCloud and Linux.

Nextcloud needs to have ownership over the mounted folder, in this case www-data:www-data. If you’ve already got it mounted on boot (which I assume is what nextcloud-data is) then you don’t need to mount it a 2nd time with fstab, but will need to change the permissions of the nextcloud-data folder to prevent NC flagging it as unable to write to.

Furthermore, if you’ve already setup Nextcloud, you’ll need to move the current data directory to the share and update the config.php file to reflect this, as well as the Nextcloud database.

Ultimately unless that nextcloud-data folder you want to mount as /var/www/nextcloud-data is setup in such a way to ensure www-data owns, and will continue to own the files put there, this isn’t going to work properly and it’d be easier to add in the SMB/CIFs share (which I assume it is?) as an external storage directory you can authenticate against which will ensure the permissions issue doesn’t return.

Again - Thank you :slight_smile:

I have the nextcloud-data folder mountpoint setup so that www-data:www-data owns it and the contents - and even tested dragging (from a windows PC) a file into /nextcloud-data/chad/ (various folders) and the dragged-in file shows as being owned by www-data but it doesn’t “appear” in NextCloud itself. I suspect that unless a file is uploaded via NextCloud itself, the sql data entries are not made and thus the file isn’t “visible” in NextCloud.

So that is my big question - is there a process or mechanism that essentially allows NextCloud to monitor the folders and basically say, “oh - there’s a file I don’t have in my tables… add it to my tables and make it visible.”?

Thank you for your help with a newb :slight_smile:


i know the topic is very old, but i’m running into simmilar problems very often.
Is there a comfortable way to combine the two worlds?

I need and want to use nextcloud to share data to employees around the world, sharing data on there tablets/mobiles/laptops with the nextcloud client.

On the other side i need to share the same directory/folderstructure to the employees in the office.

In the office we tried to use webdav and ldap auth, what was working, but the performance was so XXXXXXL bad that noone could work in a reasonable way.

i likewise thought about transfering the data directory to a ntfs share.

Did noone run into that right now??

I tried so many different scenarios (SSO&SAML/ADFS), but the “magig click” is missing…

if someone has a “cute” :wink: idea … I’m happy

I am with ITW and the OP.
I have had the same exact frustrations as the OP and know it has to do with permissions but have no idea how to set them correctly on my windows share mounted drive.

I know I can use sudo to make folders and files directly within linux but can’t make any file, folder or even drag something in using the nextcloud interface.

What commands do I need to run to make my mounted windows share drive have all the correct permissions?
I tried mounting with fstab and couldn’t get it to mount.
I had to use:
sudo mount -t cifs //192.168.XX.XXX/x -o username=server /mnt/winshare
to get it to mount.

Please if anyone could help!

Hi, let us discuss this here: