# How to set the flows\_cred.json location?

**URL:** <https://discourse.nodered.org/t/how-to-set-the-flows-cred-json-location/32745>\
**Category:** General\
**Created:** [11 September 2020 12:07 UTC](https://discourse.nodered.org/t/how-to-set-the-flows-cred-json-location/32745 "2020-09-11T12:07:24Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jostor](https://avatars.discourse-cdn.com/v4/letter/j/dbc845/32.png) [@jostor](https://discourse.nodered.org/u/jostor)\
**Post date:** [11 September 2020 12:07 UTC](https://discourse.nodered.org/t/how-to-set-the-flows-cred-json-location/32745/1 "2020-09-11T12:07:25Z")

</div>

In my settings.js file I have set `flowFile: '/data/node-red/flows.json',`  
The flows.json file is now located in `/data/node-red/`. This works as expected, but I also expected the flows\_cred.json file to be located in the same folder. That's not the case. It is still stored to /home/username/.node-red/. But the filename is changed to flows\_cred.json, instead of flows\_\_cred.json. How can i change the path to the flows\_cred.json file?  
I am using node-red v0.19.5

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [11 September 2020 12:23 UTC](https://discourse.nodered.org/t/how-to-set-the-flows-cred-json-location/32745/2 "2020-09-11T12:23:07Z")

</div>

Hi @jostor, welcome to the forum.

Node-RED will always place the credentials file in the user data directory, alongside the other user files. There is no option available to have it saved somewhere else.

---

<div class="post-metadata">

**Author:** ![jostor](https://avatars.discourse-cdn.com/v4/letter/j/dbc845/32.png) [@jostor](https://discourse.nodered.org/u/jostor)\
**Post date:** [11 September 2020 13:34 UTC](https://discourse.nodered.org/t/how-to-set-the-flows-cred-json-location/32745/3 "2020-09-11T13:34:04Z")

</div>

Thanks for your reply and explanation.  
I see that it is possible to use another user data directory. Either by setting it in settings.js with userDir or by starting node-red with the `--userDir` option. Isn't that correct?  
If I have an already running system where userDir is set to default (`/home/user/.node-red/`), and I want to move the userDir to `/data/node-red/`, can I just move all the files from `/home/user/.node-red/` to `/data/node-red/` and start node-red with the `--userDir /data/node-red/` option? Or will this fail in any way?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [11 September 2020 13:55 UTC](https://discourse.nodered.org/t/how-to-set-the-flows-cred-json-location/32745/4 "2020-09-11T13:55:11Z")

</div>

> [@jostor](#):
>
> can I just move all the files from `/home/user/.node-red/` to `/data/node-red/` and start node-red with the `--userDir /data/node-red/` option?

Yes. Make sure you include the hidden files in `/home/user/.node-red/` - those that begin with a `.` such as `.config.json`.

---

<div class="post-metadata">

**Author:** ![jostor](https://avatars.discourse-cdn.com/v4/letter/j/dbc845/32.png) [@jostor](https://discourse.nodered.org/u/jostor)\
**Post date:** [11 September 2020 14:02 UTC](https://discourse.nodered.org/t/how-to-set-the-flows-cred-json-location/32745/5 "2020-09-11T14:02:34Z")

</div>

Thanks! I will try.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [11 September 2020 14:10 UTC](https://discourse.nodered.org/t/how-to-set-the-flows-cred-json-location/32745/6 "2020-09-11T14:10:35Z")

</div>

Also, obviously, the user running node red will have to have full access to that folder.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [11 September 2020 14:16 UTC](https://discourse.nodered.org/t/how-to-set-the-flows-cred-json-location/32745/7 "2020-09-11T14:16:45Z")

</div>

Rather than moving the files you could make /data/node-red be a link to the existing .node-red folder, though that may not be appropriate for your requirements. It can make life simpler when it comes to updating node red for example.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [10 November 2020 14:16 UTC](https://discourse.nodered.org/t/how-to-set-the-flows-cred-json-location/32745/8 "2020-11-10T14:16:48Z")

</div>

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