# Use of environment variables to set editor user name and password

**URL:** <https://discourse.nodered.org/t/use-of-environment-variables-to-set-editor-user-name-and-password/54345>\
**Category:** General\
**Created:** [26 November 2021 15:55 UTC](https://discourse.nodered.org/t/use-of-environment-variables-to-set-editor-user-name-and-password/54345 "2021-11-26T15:55:46Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![hammoaj](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hammoaj/32/1998_2.png) [@hammoaj](https://discourse.nodered.org/u/hammoaj)\
**Post date:** [26 November 2021 15:55 UTC](https://discourse.nodered.org/t/use-of-environment-variables-to-set-editor-user-name-and-password/54345/1 "2021-11-26T15:55:46Z")

</div>

Has the option to use NODE\_RED\_USERNAME and NODE\_RED\_PASSWORD to set an admin login for the editor been removed? It works in NR 1.x, but apparently not in NR 2.x.

Thanks

---

<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:** [26 November 2021 16:00 UTC](https://discourse.nodered.org/t/use-of-environment-variables-to-set-editor-user-name-and-password/54345/2 "2021-11-26T16:00:21Z")

</div>

Hi @hammoaj

those env vars are specific to the wrapper used when running Node-RED in IBM Cloud. It isn't a core feature.

As far as I can see, the code is still there to use them - [node-red-app/index.js at master · IBM/node-red-app · GitHub](https://github.com/IBM/node-red-app/blob/master/index.js#L36)

---

<div class="post-metadata">

**Author:** ![hammoaj](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hammoaj/32/1998_2.png) [@hammoaj](https://discourse.nodered.org/u/hammoaj)\
**Post date:** [26 November 2021 16:24 UTC](https://discourse.nodered.org/t/use-of-environment-variables-to-set-editor-user-name-and-password/54345/3 "2021-11-26T16:24:49Z")

</div>

Thanks @knolleary

Am I right in thinking that I read that you can use environment variables to override individual options in the settings file? If so, could you point me at the documentation?

---

<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:** [26 November 2021 16:32 UTC](https://discourse.nodered.org/t/use-of-environment-variables-to-set-editor-user-name-and-password/54345/4 "2021-11-26T16:32:53Z")

</div>

The IBM-specific env vars are listed here: [GitHub - IBM/node-red-app: Node-RED application that can be deployed into IBM Cloud with a few clicks](https://github.com/ibm/node-red-app#environment-variables)

---

<div class="post-metadata">

**Author:** ![hammoaj](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hammoaj/32/1998_2.png) [@hammoaj](https://discourse.nodered.org/u/hammoaj)\
**Post date:** [26 November 2021 17:02 UTC](https://discourse.nodered.org/t/use-of-environment-variables-to-set-editor-user-name-and-password/54345/5 "2021-11-26T17:02:47Z")

</div>

Hi Nick - that wasn't a question re IBM. More specifically it was a question as to whether I can set an environment variable when I run a docker container versus having to update the settings file.

For example if I want to override `httpAdminRoot` is there a way of doing it with a environment variable?

---

<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:** [26 November 2021 17:05 UTC](https://discourse.nodered.org/t/use-of-environment-variables-to-set-editor-user-name-and-password/54345/6 "2021-11-26T17:05:52Z")

</div>

The only env vars the core supports are:

- `NODE_RED_HOME` - to set the userDir (same as the `-u` command line option)
- `NODE_RED_ENABLE_SAFE_MODE` - to start in safe mode (same as `--safe` option)
- `NODE_RED_ENABLE_PROJECTS` - to enable the projects feature
- `NODE_RED_ENABLE_TOURS` - to enable/disable the new welcome tour feature

---

<div class="post-metadata">

**Author:** ![hammoaj](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hammoaj/32/1998_2.png) [@hammoaj](https://discourse.nodered.org/u/hammoaj)\
**Post date:** [26 November 2021 17:18 UTC](https://discourse.nodered.org/t/use-of-environment-variables-to-set-editor-user-name-and-password/54345/7 "2021-11-26T17:18:20Z")

</div>

Thanks! I must have been dreaming it.

---

<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:** [26 November 2021 17:22 UTC](https://discourse.nodered.org/t/use-of-environment-variables-to-set-editor-user-name-and-password/54345/8 "2021-11-26T17:22:10Z")

</div>

Perhaps you edited settings.js to use the env var.

---

<div class="post-metadata">

**Author:** ![hammoaj](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hammoaj/32/1998_2.png) [@hammoaj](https://discourse.nodered.org/u/hammoaj)\
**Post date:** [1 December 2021 12:33 UTC](https://discourse.nodered.org/t/use-of-environment-variables-to-set-editor-user-name-and-password/54345/9 "2021-12-01T12:33:13Z")

</div>

I did precisely that!!

Can the -D option when you call mode-red also be used to do this?

---

<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:** [1 December 2021 13:39 UTC](https://discourse.nodered.org/t/use-of-environment-variables-to-set-editor-user-name-and-password/54345/10 "2021-12-01T13:39:14Z")

</div>

Well `node-red -h` suggests that you can. Have you tried?

---

<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:** [30 January 2022 13:40 UTC](https://discourse.nodered.org/t/use-of-environment-variables-to-set-editor-user-name-and-password/54345/11 "2022-01-30T13:40:07Z")

</div>

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