# Setting a new data directory

**URL:** <https://help.nextcloud.com/t/setting-a-new-data-directory/22658>\
**Category:** ℹ️ Support\
**Created:** [October 22, 2017, 3:32pm UTC](https://help.nextcloud.com/t/setting-a-new-data-directory/22658 "2017-10-22T15:32:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![lfod14](https://help.nextcloud.com/letter_avatar/lfod14/32/6_22734026db12803ebb3e059622ac3534.png) [@lfod14](https://help.nextcloud.com/u/lfod14)\
**Post date:** [October 22, 2017, 3:32pm UTC](https://help.nextcloud.com/t/setting-a-new-data-directory/22658/1 "2017-10-22T15:32:06Z")

</div>

Hey guys, stupid question on setting the location of a data directory, I did a search but all I’m coming up with is posts regarding people changing theirs after everything is up and running and all the possible issues that can come along with that. Is it not possible to just set it to be where you want it at install time prior to it being loaded up with your data? I can’t imagine this hasn’t been asked but I’m unable to find any posts on this. This setup would be on Ubuntu Server and installation via a snap if that makes any difference.

---

<div class="post-metadata">

**Author:** ![Therion7777](https://help.nextcloud.com/user_avatar/help.nextcloud.com/therion7777/32/15432_2.png) [@Therion7777](https://help.nextcloud.com/u/Therion7777)\
**Post date:** [October 23, 2017, 8:00am UTC](https://help.nextcloud.com/t/setting-a-new-data-directory/22658/2 "2017-10-23T08:00:22Z")

</div>

> [@Is there a safe and reliable way to move data directory out of web root?](https://help.nextcloud.com/t/is-there-a-safe-and-reliable-way-to-move-data-directory-out-of-web-root/3642?source_topic_id=11156):
>
> My installation seems to be working well, now I want to do a little bit to secure it. I have Nextcloud 10 on Ubuntu 16.04. It seems like the first thing I should do is move my data directory out of web root. I SO don’t want to break my installation. Is there a good tutorial on how to accomplish this and verify once complete that Nextcloud is still functioning properly? Thanks, and I have to say, I’ve been playing around with it and it’s fantastic, doing exactly what I was hoping.

---

<div class="post-metadata">

**Author:** ![MichaIng](https://help.nextcloud.com/user_avatar/help.nextcloud.com/michaing/32/2125_2.png) [@MichaIng](https://help.nextcloud.com/u/MichaIng)\
**Post date:** [October 23, 2017, 11:13am UTC](https://help.nextcloud.com/t/setting-a-new-data-directory/22658/3 "2017-10-23T11:13:23Z")

</div>

Or see my howto, which is based on all the info of the link above:

> [@HowTo: Change / Move data directory after installation](https://help.nextcloud.com/t/howto-change-move-data-directory-after-installation/17170):
>
> > **Snap/Docker/VM users click here!**
> >
> > Note that this HowTo does not apply to Nextcloud containers/appliances or the official Nextcloud VM from \<a href="https://www.hanssonit.se/nextcloud-vm/" rel="noopener nofollow ugc"\>Hansson IT\</a\>. If you use Nextcloud Snap, follow their official simple instructions: \<a href="https://github.com/nextcloud/nextcloud-snap/wiki/Change-data-directory-to-use-another-disk-partition" class="inline-onebox"\>Change …

And it is possible to set data dir at setup, maybe you overseen the possibility on web ui installation.

---

<div class="post-metadata">

**Author:** ![lfod14](https://help.nextcloud.com/letter_avatar/lfod14/32/6_22734026db12803ebb3e059622ac3534.png) [@lfod14](https://help.nextcloud.com/u/lfod14)\
**Post date:** [October 24, 2017, 9:57am UTC](https://help.nextcloud.com/t/setting-a-new-data-directory/22658/4 "2017-10-24T09:57:50Z")

</div>

I’ve seen that option in some screenshots and installation videos, but I definitely don’t have it on mine when I first run. Only difference I see is I’m installing from a snap. I’m going to do it the hard (normal) way today and see if that option shows then.

---

<div class="post-metadata">

**Author:** ![MichaIng](https://help.nextcloud.com/user_avatar/help.nextcloud.com/michaing/32/2125_2.png) [@MichaIng](https://help.nextcloud.com/u/MichaIng)\
**Post date:** [October 24, 2017, 11:43am UTC](https://help.nextcloud.com/t/setting-a-new-data-directory/22658/5 "2017-10-24T11:43:17Z")

</div>

Okay for snap it might be different, I have no idea about that.

---

<div class="post-metadata">

**Author:** ![system](https://help.nextcloud.com/user_avatar/help.nextcloud.com/system/32/29333_2.png) [@system](https://help.nextcloud.com/u/system)\
**Post date:** [September 23, 2024, 6:11pm UTC](https://help.nextcloud.com/t/setting-a-new-data-directory/22658/6 "2024-09-23T18:11:39Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 9, 2024, 1:37pm UTC](https://help.nextcloud.com/t/setting-a-new-data-directory/22658/7 "2024-12-09T13:37:32Z")

</div>


