# Change Storage Folder

**URL:** <https://discourse.getcockpit.com/t/change-storage-folder/607>\
**Category:** Support\
**Created:** [February 26, 2019, 12:04am UTC](https://discourse.getcockpit.com/t/change-storage-folder/607 "2019-02-26T00:04:18Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![putude](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/putude/32/254_2.png) [@putude](https://discourse.getcockpit.com/u/putude)\
**Post date:** [February 26, 2019, 12:04am UTC](https://discourse.getcockpit.com/t/change-storage-folder/607/1 "2019-02-26T00:04:18Z")

</div>

Hi,  
I am a new user of cockpitcms.  
I would like to ask, is it possible to move “Storage” folder to outside the cockpits folder (ie, on (docroot)/storage) ?  
Thank you.

---

<div class="post-metadata">

**Author:** ![pauloamgomes](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/pauloamgomes/32/48_2.png) [@pauloamgomes](https://discourse.getcockpit.com/u/pauloamgomes)\
**Post date:** [February 26, 2019, 3:25pm UTC](https://discourse.getcockpit.com/t/change-storage-folder/607/2 "2019-02-26T15:25:45Z")

</div>

Think should be possible, try to add to your `config.yaml` something like:

```auto
paths:
  "#storage": /var/www/your-storage-folder

```

---

<div class="post-metadata">

**Author:** ![serjoscha87](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/serjoscha87/32/151_2.png) [@serjoscha87](https://discourse.getcockpit.com/u/serjoscha87)\
**Post date:** [February 26, 2019, 6:19pm UTC](https://discourse.getcockpit.com/t/change-storage-folder/607/3 "2019-02-26T18:19:03Z")

</div>

try putting this to your settings:

```
          finder.path : /new_storage
          assets.path : /new_storage/assets
          media.path : /new_storage/media
```

---

<div class="post-metadata">

**Author:** ![putude](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/putude/32/254_2.png) [@putude](https://discourse.getcockpit.com/u/putude)\
**Post date:** [February 28, 2019, 8:57am UTC](https://discourse.getcockpit.com/t/change-storage-folder/607/4 "2019-02-28T08:57:02Z")

</div>

thank you @pauloamgomes and @serjoscha87 for your response.  
I try the @pauloamgomes method. And it works!

---

<div class="post-metadata">

**Author:** ![patricksebastien](https://avatars.discourse-cdn.com/v4/letter/p/cc9497/32.png) [@patricksebastien](https://discourse.getcockpit.com/u/patricksebastien)\
**Post date:** [February 12, 2020, 7:55pm UTC](https://discourse.getcockpit.com/t/change-storage-folder/607/5 "2020-02-12T19:55:50Z")

</div>

It doesn’t work with version 0.10.0. I need to move the storage folder on another disk, tried to add your config but cockpitcms stills refer to the storage folder inside the webroot.

Any idea?

---

<div class="post-metadata">

**Author:** ![pauloamgomes](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/pauloamgomes/32/48_2.png) [@pauloamgomes](https://discourse.getcockpit.com/u/pauloamgomes)\
**Post date:** [February 12, 2020, 9:27pm UTC](https://discourse.getcockpit.com/t/change-storage-folder/607/6 "2020-02-12T21:27:59Z")

</div>

> [@pauloamgomes](#):
>
> paths: “#storage”: /var/www/your-storage-folder

yes, you need a few more replacements in the configuration, e.g.:

```auto
paths:
  "#storage": /var/www/html/storage2
  "#pstorage": /var/www/html/storage2
  "#data" /var/www/html/storage2/data
  "#cache": /var/www/html/storage2/cache
  "#tmp": /var/www/html/storage2/tmp
  "#thumbs": /var/www/html/storage2/thumbs
  "#uploads": /var/www/html/storage2/uploads

```

---

<div class="post-metadata">

**Author:** ![patricksebastien](https://avatars.discourse-cdn.com/v4/letter/p/cc9497/32.png) [@patricksebastien](https://discourse.getcockpit.com/u/patricksebastien)\
**Post date:** [February 12, 2020, 11:03pm UTC](https://discourse.getcockpit.com/t/change-storage-folder/607/7 "2020-02-12T23:03:42Z")

</div>

I’m still getting a 500:  
_“#data”:_

```auto
    paths:
        "#storage": /ssd2/cockpitcms/storage
        "#pstorage": /ssd2/cockpitcms/storage
        "#data": /ssd2/cockpitcms/storage/data
        "#cache": /ssd2/cockpitcms/storage/cache
        "#tmp": /ssd2/cockpitcms/storage/tmp
        "#thumbs": /ssd2/cockpitcms/storage/thumbs
        "#uploads": /ssd2/cockpitcms/storage/uploads

```

When searching for pstorage, I get:

```auto
./config/config.yaml:# "#pstorage": /ssd2/cockpitcms/storage
./modules/Cockpit/Controller/Utils.php: $dirs = ['#cache:','#tmp:','#thumbs:', '#pstorage:tmp'];
./modules/Cockpit/views/layouts/app.php: var PUBLIC_STORAGE_URL = '{{ rtrim($app->pathToUrl('#pstorage:'), '/') }}';
./modules/Cockpit/bootstrap.php: $dirs = ['#cache:','#tmp:','#thumbs:', '#pstorage:tmp'];
./bootstrap.php: '#pstorage' => COCKPIT_PUBLIC_STORAGE_FOLDER,
./storage/tmp/app.php.xxx.lexy.php: var PUBLIC_STORAGE_URL = '<?php echo rtrim($app->pathToUrl('#pstorage:'), '/') ; ?>';
./lib/LimeExtra/App.php: $path = '#pstorage:tmp/'.$jshash.'.js';

```

---

<div class="post-metadata">

**Author:** ![pauloamgomes](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/pauloamgomes/32/48_2.png) [@pauloamgomes](https://discourse.getcockpit.com/u/pauloamgomes)\
**Post date:** [February 13, 2020, 9:16am UTC](https://discourse.getcockpit.com/t/change-storage-folder/607/8 "2020-02-13T09:16:47Z")

</div>

thats weird, I tested with the above changes, copied storage to another place and it worked

---

<div class="post-metadata">

**Author:** ![patricksebastien](https://avatars.discourse-cdn.com/v4/letter/p/cc9497/32.png) [@patricksebastien](https://discourse.getcockpit.com/u/patricksebastien)\
**Post date:** [February 13, 2020, 2:49pm UTC](https://discourse.getcockpit.com/t/change-storage-folder/607/9 "2020-02-13T14:49:38Z")

</div>

Indeed, I don’t get it either…  
For now I am using a symbolic link. Seems to do the job.

Thanks for your time Paulo.

---

<div class="post-metadata">

**Author:** ![putude](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/putude/32/254_2.png) [@putude](https://discourse.getcockpit.com/u/putude)\
**Post date:** [February 13, 2020, 11:33pm UTC](https://discourse.getcockpit.com/t/change-storage-folder/607/10 "2020-02-13T23:33:09Z")

</div>

just FYI, from the beginning until now, I still use it. and there is no problem.

# Cockpit settings

paths:  
“#storage”: /home/mydomain/web/mydomain.com/public\_html/storage  
“#data”: /home/mydomain/web/mydomain.com/public\_html/storage/data  
“#cache”: /home/mydomain/web/mydomain.com/public\_html/storage/cache  
“#tmp”: /home/mydomain/web/mydomain.com/public\_html/storage/tmp  
“#thumbs”: /home/mydomain/web/mydomain.com/public\_html/storage/thumbs  
“#uploads”: /home/mydomain/web/mydomain.com/public\_html/storage/uploads

Make sure you set correct owner and permission (recursive) on the storage folder.

---

<div class="post-metadata">

**Author:** ![raffaelj](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/raffaelj/32/331_2.png) [@raffaelj](https://discourse.getcockpit.com/u/raffaelj)\
**Post date:** [February 15, 2020, 6:18pm UTC](https://discourse.getcockpit.com/t/change-storage-folder/607/11 "2020-02-15T18:18:23Z")

</div>

> [@patricksebastien](#):
>
> I’m still getting a 500

Not sure, if it is related - I had an issue in the past with Xampp7 on a Windows machine, where `array_replace_recursive` with key names starting with `#` crashed the apache. I had this issue when fiddling and testing with these paths via `config.yaml`.
