Install node-red without internet access?

1,779 views
Skip to first unread message

Chris Jefferies

unread,
Feb 5, 2018, 1:19:11 PM2/5/18
to Node-RED
In our corporate setup we maintain a few internal yum repos from which we install our applications.   Almost all of our hosts have no connection to the internet so when we puppet our hosts the RPMs are being referenced from our internal yum server.

For applications like Icinga2 and RabbitMQ, I log into an internet connected machine and install with a download only command line option and subsequently transfer all the downloaded files to our yum repo.  When I run yum install icinga2 on our non-connected hosts, it works perfectly.

I've looked around for any info about how to do the same with node-red, and it seems the best way might be to:
  • install node-red on an internet connected machine
  • zip up everything (it's not all in one location)
  • unzip it into the non-connected host
Is this the way life is for non-connected node-red installs, or for any NPM based installs?

It looks tedious to build an internal NPM repo.  We do have an internal git server which uses gitlab.

Thanks for any tips,
Chris.

Dave C-J

unread,
Feb 5, 2018, 1:59:45 PM2/5/18
to node...@googlegroups.com
Several thoughts 
(actually having typed this maybe start at 3...)

1) we do have a project https://github.com/node-red/raspbian-deb-package which we use to create a .deb package for the default Pi install.Basically it does a local install on a Pi then creates a .deb of the necessary files... that can then be installed via dpkg or apt from a repo.  Currently it is slightly back level as we are just in process of tidying up latest release before wrapping it up for Pi... But I guess something similar could be done for Yum - though I don't use it enough (aka at all) to advise.

2) the electron-node-red project does wrap up (again slightly outdated) a version of Node-RED into an electron app that can be installed - but again doesn't create an rpm as-is - but again could be modified... but it was really intended (currently) just as a way of wrapping a pre-done application rather than a general purpose editor/runtime.

3) - If you do do a clean install it should place all the core files in /usr/lib/node_modules/... (or sometimes usr/local/lib/node_modules/..) and a couple of scripts in /usr/bin  (or usr/local/bin) - so in theory they should be all you need to zip up and transfer...  (basically what option 1) is doing.... ) - but it does pre-req node.js - which is not ours to control.


Chris Jefferies

unread,
Feb 5, 2018, 4:47:40 PM2/5/18
to Node-RED
Node.js is already in our local yum repo so that's already handled.

So I'm going to use this command to zip an installed node-red system:
tar -zcvf nodered-lib.tar.gz /usr/lib/node_modules/node-red-admin/ /usr/lib/node_modules/node-red/ /usr/bin/node* /root/.node-red/

There is another folder which I am not including:
/usr/lib/node_modules/npm/

but I assume that's just for NPM.  I won't be running NPM because we're not online anyway.

I'm using a systemctl init service file to start the node-red server.  This is what my node-red.service file looks like:
[Unit]
Description=Node-Red
After=syslog.target network.target
Documentation=http://nodered.org/

[Service]
Type=simple
User=root
Group=root
WorkingDirectory=/root/.node-red
ExecStart=/usr/bin/node /bin/node-red
Nice=10
SyslogIdentifier=Node-RED
StandardOutput=syslog
Restart=on-failure
KillSignal=SIGINT

[Install]
WantedBy=multi-user.target

Normally when I install node-red components, I'm installing with a -g for global.  Is there some magic to the -g configuration or does the fact that these files are located in /usr/lib/node_modules/ mean they are, by default, global?  Does this even matter?

I can see folders for various required modules in /root/.node-red/node_modules/ which I installed through the nodes palette.

Thanks for your help, Dave.

Dave C-J

unread,
Feb 5, 2018, 5:55:43 PM2/5/18
to node...@googlegroups.com
Hi
you probably don't need node-red-admin...

We don't generally use -g.   But... in your case...
-g will install it globally - which (as long as you are root) will install them in /usr/lib/node_modules 
so in your case where you want to pre-install everything - then this will make your life easier - so for your "gold master" image you should all nodes manually using -g .
(normally users don't run as root and install extra nodes in their ~/.node-red directory - which if you did then you would need to copy those over as well.)

Dave C-J

unread,
Feb 5, 2018, 5:58:05 PM2/5/18
to node...@googlegroups.com
And generally we don't recommend running as root as the exec node (for example) could be set to run  rm -rf  ...  so be careful...

Chris Jefferies

unread,
Feb 5, 2018, 6:02:38 PM2/5/18
to Node-RED
I loaded and used node-red-admin to generate encrypted password.  Is there another way to do that?

I think this will work.

Thank you,
Chris.

Dave C-J

unread,
Feb 5, 2018, 6:43:37 PM2/5/18
to node...@googlegroups.com
Good point
As you were.

Dean Cording

unread,
Feb 5, 2018, 7:00:22 PM2/5/18
to Node-RED

Julian Knight

unread,
Feb 6, 2018, 6:52:30 AM2/6/18
to Node-RED
I would think that, for a corporate installation, you would be better off using a dedicated, non-admin install of node-red that is more in keeping with other node.js applications you might be using. That would let you have everything under a single folder if you wanted & would avoid the need for admin access in order to install.

Of course, it really depends on your requirements.
Reply all
Reply to author
Forward
0 new messages