Node-Red need to restart manually

Hello,
I have installed nod red. The problem is everytime I log out the nodered seems to be offline. I need to restart each time I log in via node-red command.

~$ node-red
7 Jul 13:22:17 - [info]

Welcome to Node-RED

7 Jul 13:22:17 - [info] Node-RED version: v1.0.6
7 Jul 13:22:17 - [info] Node.js version: v8.10.0
7 Jul 13:22:17 - [info] Linux 5.3.0-1026-gcp x64 LE
7 Jul 13:22:17 - [info] Loading palette nodes
7 Jul 13:22:18 - [info] Settings file : /home/prizal_gmail_com/.node-red/settings.js
7 Jul 13:22:18 - [info] Context store : 'default' [module=memory]
7 Jul 13:22:18 - [info] User directory : /home/prizal_gmail_com/.node-red
7 Jul 13:22:18 - [warn] Projects disabled : editorTheme.projects.enabled=false
7 Jul 13:22:18 - [info] Flows file : /home/prizal_gmail_com/.node-red/flows_nyamuk.json
7 Jul 13:22:18 - [info] Server now running at http://127.0.0.1:1880/
7 Jul 13:22:18 - [warn]


Your flow credentials file is encrypted using a system-generated key.

If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.

You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.

I run this and fails
sudo systemctl enable node-red
Failed to enable unit: Unit file node-red.service does not exist.

what does the command line say to start ?... I'll give you a clue...

Use   sudo systemctl enable nodered.service  to autostart Node-RED at every boot

so not quite the same spelling...

this is the result :slight_smile:
sudo systemctl enable nodered.service
Failed to enable unit: Unit file nodered.service does not exist.

sudo systemctl enable node-red.service
Failed to enable unit: Unit file node-red.service does not exist.

also cant find node-red in /lib/systemd/system$

1 Like

so how was it installed ? the nodered.service file should be under /lib/systemd/system if the debian install script completed successfully.

im not sure how was it installed . im confused as I read and looking for solution and found all solution that doesnt show me same result

well only the debian install script will add the necessary scripts https://nodered.org/docs/getting-started/raspberrypi#autostart-on-boot

You can just run the script in the link posted above and it will add the scripts, aswell as making sure everything else you need is there.

how do i create a script that will auto start node-red everytime ? maybe start as daemon ..

Found the solution. Thank you guys .

Solution from here :
https://nodered.org/docs/faq/starting-node-red-on-boot

my directory location is : /usr/local/bin/node-red

Thanks a lot :wink:

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