# \[SOLVED\] Owncloud Data Directory

**URL:** <https://dietpi.com/forum/t/solved-owncloud-data-directory/438>\
**Category:** Troubleshooting\
**Created:** [4 July 2016 14:58 UTC](https://dietpi.com/forum/t/solved-owncloud-data-directory/438 "2016-07-04T14:58:17Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deleted\_User\_612](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/d/ce73a5/32.png) [@Deleted\_User\_612](https://dietpi.com/forum/u/Deleted_User_612)\
**Post date:** [4 July 2016 14:58 UTC](https://dietpi.com/forum/t/solved-owncloud-data-directory/438/1 "2016-07-04T14:58:17Z")

</div>

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.

Thanks,

Tin Minnow

---

<div class="post-metadata">

**Author:** ![johnvick](https://dietpi.com/forum/user_avatar/dietpi.com/johnvick/32/16_2.png) [@johnvick](https://dietpi.com/forum/u/johnvick)\
**Post date:** [4 July 2016 18:46 UTC](https://dietpi.com/forum/t/solved-owncloud-data-directory/438/2 "2016-07-04T18:46:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Deleted\_User\_612](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/d/ce73a5/32.png) [@Deleted\_User\_612](https://dietpi.com/forum/u/Deleted_User_612)\
**Post date:** [4 July 2016 20:30 UTC](https://dietpi.com/forum/t/solved-owncloud-data-directory/438/3 "2016-07-04T20:30:14Z")

</div>

> [@johnvick](#):
>
> 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?

---

<div class="post-metadata">

**Author:** ![Fourdee](https://dietpi.com/forum/user_avatar/dietpi.com/fourdee/32/11_2.png) [@Fourdee](https://dietpi.com/forum/u/Fourdee)\
**Post date:** [5 July 2016 09:56 UTC](https://dietpi.com/forum/t/solved-owncloud-data-directory/438/4 "2016-07-05T09:56:36Z")

</div>

> [@Tin Minnow](#):
>
> 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:

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

```

---

<div class="post-metadata">

**Author:** ![Deleted\_User\_612](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/d/ce73a5/32.png) [@Deleted\_User\_612](https://dietpi.com/forum/u/Deleted_User_612)\
**Post date:** [5 July 2016 19:15 UTC](https://dietpi.com/forum/t/solved-owncloud-data-directory/438/5 "2016-07-05T19:15:45Z")

</div>

> [@Fourdee](#):
>
> Lets check to see if its active and check permissions, please run these and paste results:
> 
> ```plaintext
> 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.

```plaintext
~# 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

```

Thanks,

Tin Minnow

---

<div class="post-metadata">

**Author:** ![Fourdee](https://dietpi.com/forum/user_avatar/dietpi.com/fourdee/32/11_2.png) [@Fourdee](https://dietpi.com/forum/u/Fourdee)\
**Post date:** [6 July 2016 17:28 UTC](https://dietpi.com/forum/t/solved-owncloud-data-directory/438/6 "2016-07-06T17:28:51Z")

</div>

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:

```nohighlight
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](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.

---

<div class="post-metadata">

**Author:** ![Deleted\_User\_612](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/d/ce73a5/32.png) [@Deleted\_User\_612](https://dietpi.com/forum/u/Deleted_User_612)\
**Post date:** [7 July 2016 01:45 UTC](https://dietpi.com/forum/t/solved-owncloud-data-directory/438/7 "2016-07-07T01:45:36Z")

</div>

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?

> [@johnvick](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![Fourdee](https://dietpi.com/forum/user_avatar/dietpi.com/fourdee/32/11_2.png) [@Fourdee](https://dietpi.com/forum/u/Fourdee)\
**Post date:** [7 July 2016 18:24 UTC](https://dietpi.com/forum/t/solved-owncloud-data-directory/438/8 "2016-07-07T18:24:37Z")

</div>

> [@Tin Minnow](#):
>
> 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?
> 
> > [@johnvick](#):
> >
> > 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.

Not sure, but I can’t access the data when browsing the web url /var/www/owncloud/data:  
[http://192.168.0.112/owncloud/data](http://192.168.0.112/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.

```plaintext
/mnt/dietpi_userdata/owncloud_data

```

---

<div class="post-metadata">

**Author:** ![Deleted\_User\_612](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/d/ce73a5/32.png) [@Deleted\_User\_612](https://dietpi.com/forum/u/Deleted_User_612)\
**Post date:** [9 July 2016 19:56 UTC](https://dietpi.com/forum/t/solved-owncloud-data-directory/438/9 "2016-07-09T19:56:50Z")

</div>

> [@Fourdee](#):
>
> > [@Tin Minnow](#):
> >
> > 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?
> > 
> > > [@johnvick](#):
> > >
> > > 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.
> 
> Not sure, but I can’t access the data when browsing the web url /var/www/owncloud/data:  
> [http://192.168.0.112/owncloud/data](http://192.168.0.112/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.
> 
> ```plaintext
> /mnt/dietpi_userdata/owncloud_data
> 
> ```

That’s good enough for me!
