FAQ 3: What different ways are there to install Node-RED and which is best?

There are several possible ways to install Node-RED, this post provides an overview and some thoughts about when you might want to use which approach.

There are three basic approaches to installing Node-RED. Which of these is “best” for you will depend on your knowledge, willingness to learn, desire or need to gain maximum flexibility and so on. Only you can work that out. It should also be noted that you should be able to mix and max these approaches if you really want to (though I can’t say that I would personally recommend that).

Less flexible and possibly a little less secure. Not the best for “production” installations. Can confuse beginners into installing other Nodes and packages into global when they shouldn’t. Hard to work out where the global files are.

This is a more “node.js way” of installing - global installations being good for exposing global commands but may sometimes be less secure.

It is a more self-contained installation. Everything can be in 1 place under a single folder structure. This makes it easier to back-up everything together. But it doesn’t force you to work this way, you can keep your userDir folder separate if you like.

It allows you to run different instances of Node-RED using different versions. Good for testing major Node-RED upgrades and for testing custom nodes or flows against different versions.

You are in control. You know where everything is because you chose to put it there.

You control access to all files and folders and so this can be a more flexible installation. You could also have different instances of node-red on the same device with different folder/file access levels. Possible development and test instances on the same device.

A good way to create a more portable installation of Node-RED since the whole folder structure can be easily copied/archived, etc.

It is my personal belief that this is also the best approach for people who want to learn how Node.js and/or Node-RED works. But then again, maybe that’s just my warped mind!

Best for flexibility and control. Good for control of security. Best for running different versions of Node-RED in parallel on one device. Good for ease of backup/recovery and for creating distributable copies of a Node-RED application. Best for embedding Node-RED into an existing or new Node.js app.

Adds significant hidden complexity and requires good knowledge of the container technology to isolate and fix issues. Also likely to have higher resource requirements than running separate instances in other ways. Experience from the Node-RED forum suggests that a decent knowledge of Docker/snap is recommended.

There is some additional information that I wrote in a recent blog post: