# MQTT configuration from file or env. variable

**URL:** https://discourse.nodered.org/t/mqtt-configuration-from-file-or-env-variable/11617
**Category:** General
**Created:** [27 May 2019 23:08 UTC](https://discourse.nodered.org/t/mqtt-configuration-from-file-or-env-variable/11617 "2019-05-27T23:08:04Z")
**Posts on this page:** 1
**Showing post:** 4

<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: [28 May 2019 13:43 UTC](https://discourse.nodered.org/t/mqtt-configuration-from-file-or-env-variable/11617/4 "2019-05-28T13:43:01Z")

</div>

Hi @Chris24918

you can do this using environment variables.

Any node property can be set to something like `$(MY_CLIENT_ID)` and the runtime will substitute the value of the env var `MY_CLIENT_ID` before it gets passed to the node. This cannot be used to insert env vars into part of the value - it has to be the entire value - so `$(MY_CLIENT_ID)_FOO` will not work.

That is exactly what you want if you are deploying the same set of flows to 50+ devices and you need each to insert its own configuration values.

---

_[View the full topic](https://discourse.nodered.org/t/mqtt-configuration-from-file-or-env-variable/11617)._
