Skip to content

Instantly share code, notes, and snippets.

@azureru
Created May 20, 2017 20:30
Show Gist options
  • Save azureru/8ec41c91437c6fee58fb1b72c3d684f8 to your computer and use it in GitHub Desktop.
Save azureru/8ec41c91437c6fee58fb1b72c3d684f8 to your computer and use it in GitHub Desktop.
Node-Red On Armbian
# remove repo versions
sudo apt-get remove -y nodered nodejs nodejs-legacy npm
sudo apt-get autoremove -y
# use nodesource
curl -sL https://deb.nodesource.com/setup_4.x | sudo bash -
# necessary dependencies (e.g for node-gyp) and ofcourse the node itself
sudo apt-get install -y build-essential python-dev nodejs
# node-red package
sudo npm cache clean
sudo npm install -g --unsafe-perm node-red
# systemd service file to start Node-RED
[Unit]
Description=Node-RED graphical event wiring tool.
Wants=network.target
Documentation=http://nodered.org/docs/hardware/raspberrypi.html
[Service]
Type=simple
# Run as root user in order to have access to gpio pins
User=root
Group=root
Nice=5
Environment="NODE_OPTIONS=--max-old-space-size=128"
#Environment="NODE_RED_OPTIONS=-v"
ExecStart=/usr/bin/env node-red-pi $NODE_OPTIONS $NODE_RED_OPTIONS
KillSignal=SIGINT
Restart=on-failure
SyslogIdentifier=Node-RED
[Install]
WantedBy=multi-user.target
# Dont forget to
# sudo systemctl daemon-reload
# sudo systemctl enable nodered.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment