This site uses cookies for functional purposes. To continue please read and agree to our Data Privacy.

By closing this message, you consent to our use of cookies on this device.

PLCnext on Instagram  PLCnext on YouTube Github PLCnext CommunityStore PLCnext Community

 

 How to create a Blog Entry

How to start Node-RED automatically when the PLC starts

=== UPDATE ====

The recommended way to install node.js and npm on a PLCnext Control is now through the PLCnext Store.

It appears that the procedure described below may not work after installing node from the PLCnext Store. In this case, an alternative to pm2 may be needed to automatically start node-red. You can raise general issues related to pm2 on their Github page.

The original article remains below.


Procedure

Log in to the PLC as admin and issue the following commands:

npm install -g pm2
pm2 start node-red
pm2 save
pm2 startup

Restart the PLC and check that Node-RED has started automatically.

Thank you to PLCnext Community member David Petter for these instructions.

More information on starting Node-RED using pm2 can be found here: https://nodered.org/docs/getting-started/running

Most clicked articles in the makers blog