# Error: Disconnected from MQTT broker

**URL:** <https://discourse.nodered.org/t/error-disconnected-from-mqtt-broker/54772>\
**Category:** General\
**Created:** [6 December 2021 08:08 UTC](https://discourse.nodered.org/t/error-disconnected-from-mqtt-broker/54772 "2021-12-06T08:08:19Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![Utkarsh](https://avatars.discourse-cdn.com/v4/letter/u/e9bcb4/32.png) [@Utkarsh](https://discourse.nodered.org/u/Utkarsh)\
**Post date:** [7 December 2021 12:37 UTC](https://discourse.nodered.org/t/error-disconnected-from-mqtt-broker/54772/22 "2021-12-07T12:37:31Z")

</div>

I just ran `sudo systemctl enable nodered` for the first time and now I have both the files.  
Thus, Node-RED should restart on server reboot.  
Now I need to remove restarting command from the crontab file.  
PS. Node-RED is running on Apache2 server Ubuntu 18.04

---

<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:** [7 December 2021 13:39 UTC](https://discourse.nodered.org/t/error-disconnected-from-mqtt-broker/54772/23 "2021-12-07T13:39:08Z")

</div>

> [@Utkarsh](#):
>
> So you are suggesting that I should install it as a user rather than root.

Yes. Run the script when logged in as the user that should run node-red.  
Or you could just edit the systemd service file `/lib/systemd/system/nodered.service` and change all references to `root` to the user you want. So that is User, Group, Working directory, and environment file.  
Then reboot.

---

<div class="post-metadata">

**Author:** ![Utkarsh](https://avatars.discourse-cdn.com/v4/letter/u/e9bcb4/32.png) [@Utkarsh](https://discourse.nodered.org/u/Utkarsh)\
**Post date:** [8 December 2021 07:20 UTC](https://discourse.nodered.org/t/error-disconnected-from-mqtt-broker/54772/24 "2021-12-08T07:20:49Z")

</div>

Thanks for the explanation. I will do the modifications accordingly.

---

<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:** [6 February 2022 07:21 UTC](https://discourse.nodered.org/t/error-disconnected-from-mqtt-broker/54772/25 "2022-02-06T07:21:14Z")

</div>

Closed on 6 February 2022 07:21 UTC

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

[Previous page](https://discourse.nodered.org/t/error-disconnected-from-mqtt-broker/54772.md?page=1)
