[SOLVED] Owncloud Data Directory

Just started out using Dietpi and it’s awesome and very intuitive.

Only problem so far is, having installed ownCloud and then setting up. Tried to set the DataFolder as /var/lib/owncloud/data, as described in the configuration guide, but received an error along the lines of write access denied. Then tried the default option /var/www/owncloud/data and that worked fine.

Does it make a difference having it at /var/www/owncloud/data ? Just wondering whether or not to reinstall ownCloud.


Tin Minnow

The recommendation is that your data folder is not under the www directory to make it more secure. Your problem is probably due to wrong file/folder permissions.

Thanks, that’s good to know. How would I go about changing the file permisions for that folder?

Hi Tin,

DietPi-Software sets up a symlink (shortcut) from /var/lib/owncloud/data to /mnt/dietpi_userdata during install.

Lets check to see if its active and check permissions, please run these and paste results:

ls -lha /var/lib/owncloud/data
ls -lha /mnt/dietpi_userdata
ls -lha $(readlink /mnt/dietpi_userdata)

Hi Fourdee

These are the results. I did actually reinstall Dietpi and have yet to set up my owncloud admin account/data folder. Still receiving error 'Can’t create or write into the data directory /var/lib/owncloud/data ’ when trying.

~# ls -lha /var/lib/owncloud/data
ls: cannot access /var/lib/owncloud/data: No such file or directory
~# ls -lha /mnt/dietpi_userdata
lrwxrwxrwx 1 root root 10 Jul  4 20:49 /mnt/dietpi_userdata -> /mnt/usb_1
~# ls -lha $(readlink /mnt/dietpi_userdata)
total 101M
drwxr-xr-x 4 root     root     4.0K Jul  4 21:19 .
drwxr-xr-x 5 root     root     4.0K Jul  4 20:49 ..
drwx------ 2 root     root      16K Jul  4 20:39 lost+found
drwxrwx--- 3 www-data www-data 4.0K Jul  4 21:26 owncloud_data
-rw------- 1 root     root     100M Jul  4 20:49 .swapfile


Tin Minnow

Hi Tin,

Thanks for the results.

It looks like the documentation is incorrect.
/var/www/owncloud/data (not /var/lib/*) is the correct location to use when setting up Owncloud for the first time:

root@DietPi:~# ls -lha /var/www/owncloud/data
lrwxrwxrwx 1 www-data www-data 34 Jul  6 18:24 /var/www/owncloud/data -> /mnt/dietpi_userdata/owncloud_data

I’ve updated the documentation: https://dietpi.com/forum/t/dietpi-software-details-for-all-installation-options/22/6 Many thanks for reporting this Tin, and please let me know if this resolves the issue.

Ok great, thanks for letting me know, it works perfectly now. And do you know if it is a security risk having it in that directory (/var/www) as johnvick suggested?

Not sure, but I can’t access the data when browsing the web url /var/www/owncloud/data:
Its also a symlink, so the physical data is located elsewhere, outside of /var/www.

You can use the below physical location (flash), or symlink (usb/custom) rather than /var/www/owncloud/data during 1st run setup. Either way, its outside the /var/www directory.


That’s good enough for me!