# Restart node-red inside node-red

**URL:** <https://discourse.nodered.org/t/restart-node-red-inside-node-red/62506>\
**Category:** General\
**Created:** [11 May 2022 12:04 UTC](https://discourse.nodered.org/t/restart-node-red-inside-node-red/62506 "2022-05-11T12:04:40Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![makerstorage](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/makerstorage/32/57594_2.png) [@makerstorage](https://discourse.nodered.org/u/makerstorage)\
**Post date:** [16 May 2022 12:18 UTC](https://discourse.nodered.org/t/restart-node-red-inside-node-red/62506/21 "2022-05-16T12:18:31Z")

</div>

thanks @r0ller  
I have to work on that.

---

<div class="post-metadata">

**Author:** ![r0ller](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/r0ller/32/14327_2.png) [@r0ller](https://discourse.nodered.org/u/r0ller)\
**Post date:** [16 May 2022 12:27 UTC](https://discourse.nodered.org/t/restart-node-red-inside-node-red/62506/22 "2022-05-16T12:27:24Z")

</div>

You're welcome. Let me know if you need more details. I did not copy our solution here as it got a bit complex, extended with user role check (we reuse the nodered authentication api for our single user dashboard ui where user roles make a difference though) and we also added a dynamic editor login enable/disable logic as well.

---

<div class="post-metadata">

**Author:** ![echocrow](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/echocrow/32/73574_2.png) [@echocrow](https://discourse.nodered.org/u/echocrow)\
**Post date:** [1 January 2023 12:57 UTC](https://discourse.nodered.org/t/restart-node-red-inside-node-red/62506/23 "2023-01-01T12:57:38Z")

</div>

for those running Node-RED in an environment that auto-restarts the service (for example in Home Assistant with Watchdog enabled):

in my case the previously posted commands (`node-red-restart`, `systemctrl`, etc.) were not available.  
what did work though is the `kill` command: Node-RED gets shut down via a `pkill node-red` exec block; Home Assistant will then auto-restart the service, which also reloads settings.js.

example flow:

```auto
[{"id":"fbaa1fab24df3a48","type":"inject","z":"efc8809275cbb7a5","name":"trigger restart","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":710,"y":620,"wires":[["deb4bf5a0e2a8e4d"]]},{"id":"deb4bf5a0e2a8e4d","type":"exec","z":"efc8809275cbb7a5","command":"pkill node-red","addpay":"","append":"","useSpawn":"false","timer":"","winHide":false,"oldrc":false,"name":"","x":880,"y":620,"wires":[[],[],[]]}]

```

[Previous page](https://discourse.nodered.org/t/restart-node-red-inside-node-red/62506.md?page=1)
