Running node-red on boot centos 7

1,520 views
Skip to first unread message

Dan Hoover

unread,
May 2, 2017, 2:15:44 PM5/2/17
to Node-RED
I'll start by saying, I'm not a linux guy if you haven't figured that out already.  I fumble my way through it (probably with a few too many sudo's in there), but I get it working.

How can I get node-red to start on Centos7 at boot?

I'm usually able to 

nano /etc/rc.d/rc.local

and (after chmodding it) add my simple node-red or sudo node-red and get it to run, but that's not working this time around.

Any ideas?

Julian Knight

unread,
May 2, 2017, 3:49:55 PM5/2/17
to Node-RED
I'm not a Centos person but I believe that 7 runs on systemd the same as the Pi and most other modern Linux versions now. So if you dig out some instructions for the Pi it should work pretty much the same.

Dan Hoover

unread,
May 2, 2017, 6:09:43 PM5/2/17
to Node-RED
I tried Dave C-J's instructions and still no dice.  Is there any reason they shouldn't have worked?

OK - so actual Node-RED should be OK to run... just the autostart pieces are missing....

If you like you can grab them from github by executing the following
NOTE they are running as sudo so feel free to download manually and move as appropriate instead
 
sudo wget https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/nodered.service -O /lib/systemd/system/nodered.service
sudo wget https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/node-red-start -O /usr/bin/node-red-start
sudo wget https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/node-red-stop -O /usr/bin/node-red-stop
sudo chmod +x /usr/bin/node-red-st*
sudo systemctl daemon-reload

This will get the up to date systemd service starter and the start and stop commands (that are then made executable).
After that it makes the new scripts executable and then refreshes the systemd config so the 
sudo systemctl enable nodered.service
should now work...

Dave C-J

unread,
May 2, 2017, 6:24:41 PM5/2/17
to node...@googlegroups.com
Well this are the files you need... But they may need to be placed in slightly different locations on Centos... 
And the .service file will need to be edited to point to the user you want to use and their home directory... Is probably not pi .

Dan Hoover

unread,
May 2, 2017, 7:19:13 PM5/2/17
to Node-RED
I'm trying but I'm not getting anywhere.  What's the best non-pi environment to setup and run node-red on a vps?

I tried ubuntu 16.04 but I spent about 90 mins with it telling me it couldn't download it.

Then  I got it running on Centos7 but I can't auto start it and when I follow the security instructions, I can't login with a password.  It always says wrong password.

Any advice?

Dave C-J

unread,
May 3, 2017, 1:58:49 AM5/3/17
to node...@googlegroups.com
Well Ubuntu or Debian should be fine. You may need to install wget and curl and maybe python, but then the bash script from the pi docs should work. What couldn't it download ? 

Dan Hoover

unread,
May 3, 2017, 8:04:49 AM5/3/17
to Node-RED
It kept telling me it couldn't download bcryptjs. 

Dan Hoover

unread,
May 3, 2017, 8:40:37 AM5/3/17
to Node-RED
 Sorry. I was wrong. The centos  7 wouldn't run on boot no matter what I did. 

The ubuntu 16.04 refuses to bring up the username and password on the web facing part.
Reply all
Reply to author
Forward
0 new messages