Installing Custom Node to Remote Server

Hello!

I am currently working on using the Admin HTTP API to install nodes to Node-RED servers. Installing to a local server is simple enough, and has no issues, but I am curious about installing a custom node to a remote Node-RED server.

The documentation shows that the POST method takes either a path to the node on your machine or the name of a module in the npm repository. Seeing as passing a local path to a directory would not work on a remote server, it seems that the only way to put a node onto a remote server is to publish the custom node to npm and install it that way. Is this thinking correct, or is there another way to do this that I am missing? In addition to this, if my thinking is correct, are there plans to add support for uploading custom nodes directly to a remote server through the API to install them rather than having to publish to npm?

Thank you!

I have never done it, but presumably you could copy the node to the remote server then use the api to install it from that directory.

This could be a good solution but, at the same time, is there a good way to generalize this to cover any remote server? I feel like there would be issues that arise around access credentials and differences in OS structure that could prevent a good general-purpose method of accomplishing it this way. But I could be overthinking it

If you need to publish to multiple servers but don't want to publish to npm then I believe there are various ways of having a private npm repository. Google will show you some no doubt. Alternatively you could just put them in a git repository on github or similar (which can be private) and pick them up from there.

one way is to use npm pack to package your node locally - then you can distribute the tgz file it creates as you wish - then run npm install yournodename.tgz in the .node-red directory as usual.

Does the old method of using the nodes folder still work? If it does, you could copy the nodes though you would still need to restart NR.

To address the bit of your question that hasn't been answered - there are no plans for this because it has never come up as a requirement.

When I created the api in the first place, I did recognise it might be something we could add - but at the time there was no need for it, so nothing more happened.

I'm sure its something we could put on the backlog to explore at some point - without committing either way on it.

1 Like

Thank you everybody for the responses. These were all helpful!