[Minor Update] alternate-node-red-installer v2.0.3

alternate-node-red-installer is not a node. It is, as it says, a template for an alternative way to install and manage Node-RED.

Install globally using npm so that the nrinstall application is globally available. Should work on all platforms supported by Node-RED.

The installer will install Node-RED to a folder and create a userDir sub-folder called data. That way everything is in a single place and can be easily backed up, copied, moved. It also allows you to easily have multiple instances of Node-RED with different Node-RED versions.

Some backup BASH shell scripts are also included along with an example settings.js file that contains some enhancements that may be of use to some people along with some additional help information formatted so that it is easier to read. An example systemd startup script is also included for Linux users.



  • Bump dependencies to latest versions.


  • An example settings.js file (data/example-settings/js)

    This contains a number of enhancements over the default including extended information that can be collapsed for easier reading.

    It also is configured to pick up the environment variables specified in this packages templates.

  • backup.sh, backupw.sh, and backupm.sh BASH scripts in the new scripts folder to efficiently back up your working Node-RED installation if installed using this alternate installer.

    The scripts should be run from CRON daily, weekly and monthly respectively.

    Please amend the indicated variables in the scripts so that they will work for your own installation.

    # Node-RED daily backup (3AM every day)
    0 3 * * * "/home/home/nrmain"/backup.sh > /dev/null
    # Node-RED weekly backup (03:30 every Sunday)
    30 3 * * 0 "/home/home/nrmain"/backupw.sh > /dev/null
    # Node-RED monthly backup (04:00 on the first of every month)
    0 4 1 * * "/home/home/nrmain"/backupm.sh > /dev/null

    They give you 7 days of daily backups, 5 weekly backups, and 12 monthly backups. They should be easy enough to adapt to whatever schedule you want.

    Output from the scripts are written to syslog, review with sudo cat /var/log/syslog | grep nrmain-backup or sudo journalctl -t nrmain-backup.

    Note that the backup scripts have been updated for Node-RED v1.3 such that data/externalModules/node_modules is excluded.



  • Node.js v10 is now the minimum version due to dependency module changes.


  • CHANGELOG and TODO files.
  • Two command line commands are now available if you install this package globally:
    • alternate-node-red-installer - OK, so this is a bit long and I can never remember it myself!
    • nrinstall - Yes, that's a bit more memorable. :sunglasses:


  • Bump to v2.0 due to breaking change. And to v2.0.1 for the extra command name.
  • Bump dependencies to latest versions.
  • Tidy and improve code.
  • Install now sets correct paths in ./system/node-red-service and ./data/envfile.ini.

Node10 is also now EOL. So you may as well start with 12 as minimum.

1 Like

Ah, but as you and Nick are always (exaggeration for effect :wink: ) telling me, we shouldn't lock out people unfortunate enough not to be able to keep up with the latest releases.

I believe the code and dependencies I'm using are fine from v10 onwards so that is what I stuck with.

I'm sure I will update once NR v2 comes out since I've not accommodated installing anything other than the current version of NR.

is this version checked out on Node-RED v2.0?

I've not tested it, so feel free, that is one of the advantages of this approach, you can install as many different versions of node-red as you like :slight_smile:

A quick check tells me it will install v2.0.x - in fact, it will always install the very latest version, that's the way the package.json is set up. You can, of course, always then go in and manually install a different version at will.

The one thing that does need updating but I couldn't until v2 was actually released is the example settings.js file. Of course node-red will put one of those in place for you and you can use the new init admin command to create a custom one. However, my example is aligned to the variables that I make available via the systemd startup script. Also very easy to take the appropriate parts across manually though.

I will throw together a suitable update when I can but at least you can work around that 1 thing. Everything else should be golden.