When running on the Raspberry Pi or other Debian-based Linux system, our install script can be used to setup a systemd service to autostart Node-RED on boot.
This guide shows how the service can be customised for some common scenarios.
The service comes configured for the pi
user. To change which user it runs as,
edit the service definition /lib/systemd/system/nodered.service
and change the
User
, Group
and WorkingDirectory
lines as appropriate. You can also set the
amount of memory space to use in MB.
[Service]
Type=simple
# Run as normal pi user - change to the user name you wish to run Node-RED as
User=<your_user>
Group=<your_user>
WorkingDirectory=/home/<your_user>
Environment="NODE_OPTIONS=--max_old_space_size=256"
...
After editing the file, run the following commands to reload the systemd daemon and then restart the Node-RED service.
sudo systemctl daemon-reload
node-red-stop
node-red-start
If you need to use a proxy for http requests within your Node-RED flows, you
need to set the HTTP_PROXY
environment variable.
Edit the service definition /lib/systemd/system/nodered.service
and add
another Environment=...
line. For example:
...
Nice=5
Environment="NODE_OPTIONS=--max-old-space-size=256"
Environment="HTTP_PROXY=my-proxy-server-address"
...
After editing the file, run the following commands to reload the systemd daemon and then restart the Node-RED service.
sudo systemctl daemon-reload
node-red-stop
node-red-start
Node-RED: Low-code programming for event-driven applications.
Copyright OpenJS Foundation and Node-RED contributors. All rights reserved. The OpenJS Foundation has registered trademarks and uses trademarks. For a list of trademarks of the OpenJS Foundation, please see our Trademark Policy and Trademark List. Trademarks and logos not indicated on the list of OpenJS Foundation trademarks are trademarks™ or registered® trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.
The OpenJS Foundation | Terms of Use | Privacy Policy | OpenJS Foundation Bylaws | Trademark Policy | Trademark List | Cookie Policy