Search code examples
raspberry-pishnode-red

How to make node-red run 24/7 on Raspberry Pi


I want to host node-red 24/7 on Raspberry Pi. Something was running it constantly, then, the power had gone out, then it came back. But, then, the data was not coming. I want the node-red to run constantly (at least when the raspberry pi is running). I tried making an .SH file to make it constantly run, here is the code:

node-red

that is the command prompt line to run node-red.

That did not work, is there something that I can do about this?


Solution

  • What you're looking for is a process manager, there are many process managers available each with their own features.

    Natively many linux distributions support this functionality via a system called systemd also called an init system.

    Docker as a system is also an option but this may be excessive for your use-case.


    Some popular process manager applications are:

    1. supervisord
    2. PM2

    Additional reading:

    A supervisord tutorial on Digital Ocean by Alex Garnett

    A systemd tutorial on Digital Ocean by Justin Ellingwood