Can I directly edit files in data directory?


I recently installed NC 18 and first trials it works great ( Calendar, Contacts, Files, Bookmarks).

The worstation where i installed the server ( a debian linux ) also has a graphical shell. Can i directly work with files in data directory ? But then they belong to www-data, at least if i create new one i expect issues, no ? or should i use the desktop client but then I’m just duplicating files on the same partition, does not seem super right.

While I found many topics regarding “move data directory” ( which actually saved me… ) I did not find info on this. Thanks for your advice / sharing your setup
And happy easter

edit : oops sorry i wrote NC 13 this is NC 18.

Not a good idea after every change on files you will have to :

Do a chown to www-data on the files
And a occ files:scan user everytime for making Nextcloud database aware of changes.

It’s usable if you are the only user on the data folder but you better install the desktop sync client.

This version went out of support last year. Please update to a recent version which has still support (currently: NC 16, 17, and 18).

No, you are not supposed to do this. You can use the external storage and use the “local external storage” where you can add a folder on your system and modify it manually outside Nextcloud. The folder and files must be accessible for the webserver user, in your case www-data.

You can, provided you run occ files:scan after editing…

Whether you should is another matter.

1 Like

Intersting, thanks, I did not know about this app. Before I mark it as solution, does it mean this folder “ext” may be synced by client ( eg on mobile ) ?

edit - tried to install the app. It is very easy to add, at least for simple use case, then this external folder is immediately accessible by other clients. Sync works immediately, seems like it is able to watch. But then I have to look at access, local user must be able to access it.

Who are you calling local users ?
Users of the computer that is the server or others users on separate computers ?

user on the server.

The “external” app solves the issue to survey folder change, but i still have a www-data owned folder. So i need the user onto the server to belong to www-data and i think this is not an issue. Also i need the directory to have default files with permission 770 and not 750. I can probably use setfacl for this.

The advice from tflidd , marked as solution, works, ie use “external storage” app and “local” storage.

In order to have www-data able to access it, the simplest is to use ACL and setfacl to allow www-data read and write access to this folder. I just set it up and it is a one shot usage.

Thanks for all answers
I can now de-duplicate my files :slight_smile:

1 Like

Another alternative is to use davfs, which provides standard linux filesystem access to files on a WebDav server.