# Portable Node-RED v2.1.3

**URL:** <https://discourse.nodered.org/t/portable-node-red-v2-1-3/53244>\
**Category:** Share Your Projects\
**Created:** [5 November 2021 04:31 UTC](https://discourse.nodered.org/t/portable-node-red-v2-1-3/53244 "2021-11-05T04:31:15Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdkrieg](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mdkrieg/32/39091_2.png) [@mdkrieg](https://discourse.nodered.org/u/mdkrieg)\
**Post date:** [5 November 2021 04:31 UTC](https://discourse.nodered.org/t/portable-node-red-v2-1-3/53244/1 "2021-11-05T04:31:15Z")

</div>

Today I needed a portable version of Node-RED to do something on a machine that I don't want to install Node onto and was pretty pleased with the result I got using electron-forge.

I know others have accomplished this before but I thought this came out pretty clean so I decided to share.

Download: [nodered-portable download | SourceForge.net](https://sourceforge.net/projects/nodered-portable) (Windows x64)

Github: [GitHub - mdkrieg/nodered-portable: Node-RED Portable Version via Electron](https://github.com/mdkrieg/nodered-portable)

Hope you find this as useful as I did,  
Cheers!

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [5 November 2021 04:51 UTC](https://discourse.nodered.org/t/portable-node-red-v2-1-3/53244/2 "2021-11-05T04:51:31Z")

</div>

Have you used standard 1880 port or switched to using another one?

---

<div class="post-metadata">

**Author:** ![mdkrieg](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mdkrieg/32/39091_2.png) [@mdkrieg](https://discourse.nodered.org/u/mdkrieg)\
**Post date:** [5 November 2021 04:57 UTC](https://discourse.nodered.org/t/portable-node-red-v2-1-3/53244/3 "2021-11-05T04:57:24Z")

</div>

Port 50820, picked by a random number generator. Changed it to not collide if already running node-red on port 1880. Ideally I'd like to find a way to customize this at launch.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [5 November 2021 05:16 UTC](https://discourse.nodered.org/t/portable-node-red-v2-1-3/53244/4 "2021-11-05T05:16:56Z")

</div>

Apart from the exercise 🙂 any reason not to use Node-RED desktop?

> **[Node-RED Desktop](https://sakazuki.github.io/node-red-desktop/)**
>
> Desktop applicaiton of Node-RED. You can get a quick and easy powerful tool.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [5 November 2021 09:49 UTC](https://discourse.nodered.org/t/portable-node-red-v2-1-3/53244/5 "2021-11-05T09:49:50Z")

</div>

Is this portable in the same sense as for example [LibreOffice Portable](https://www.libreoffice.org/download/portable-versions)?  
That is, it does not require anything to be installed on the target machine, all components can be on a USB flash drive?

I _try_ not to install anything on my Windows PC except the [PortableApps](https://portableapps.com/) platform.  
Node-Red is installed on a Raspberry Pi but I can see uses for a USB Windows installation.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [5 November 2021 11:47 UTC](https://discourse.nodered.org/t/portable-node-red-v2-1-3/53244/6 "2021-11-05T11:47:20Z")

</div>

> [@mdkrieg](#):
>
> Ideally I'd like to find a way to customize this at launch.

Normally done by referencing an environment variable in settings.js - see my alternate installer for examples.

> [@jbudd](#):
>
> Node-Red is installed on a Raspberry Pi but I can see uses for a USB Windows installation.

You won't be able to have a single portable version that works across platforms without carring copies of the (enormous) `node_modules` folder. That's because Node.js allows compiled C/C++ libraries which compile to different executables on different platforms.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [5 November 2021 12:32 UTC](https://discourse.nodered.org/t/portable-node-red-v2-1-3/53244/7 "2021-11-05T12:32:44Z")

</div>

> [@TotallyInformation](#):
>
> You won't be able to have a single portable version that works across platforms without carring copies of the (enormous) `node_modules` folder.

Hmm. Well, storage is cheap!

I don't expect it to work on different operating systems, No idea how other portable apps deal with processor architectures.

But on one of my Raspberries I see ~220MB

> du -sm /usr/lib/node\_modules/ ~/.node-red  
> 79 /usr/lib/node\_modules/  
> 140 /home/pi/.node-red

No doubt it's much bigger on WIndows! 🤔

---

<div class="post-metadata">

**Author:** ![ozpos](https://avatars.discourse-cdn.com/v4/letter/o/278dde/32.png) [@ozpos](https://discourse.nodered.org/u/ozpos)\
**Post date:** [5 November 2021 13:38 UTC](https://discourse.nodered.org/t/portable-node-red-v2-1-3/53244/8 "2021-11-05T13:38:04Z")

</div>

Not sure if this is of any use. Here is a tiny shell script that starts nr with the port number extracted from the current directory, so for example the nr directory holding the flow, settings and node\_modules would be directory\_name#xxxx where xxxx is the port number. If no # found then the default 1880 is used.

I also use yarn so that I can run multiple versions of node on the same host.

```auto
#!/bin/bash
###################
# start-nr.sh
# -----------
# launch node-red with the user dir as the current dir and a port.
#
# If the containing directory name ends in '#n' where n is a number
# e.g. directory-name#1880 
# then the number will be used as the node-red port.
######################

nr_root=$(pwd);
default_port="1880";
port_index=`expr index "$nr_root" "#"`;

if ["$port_index" -eq "0"]; then
   port=$default_port;
else
   new_port=${nr_root:$port_index};
   re='^[0-9]+$';
   if ! [[$new_port =~ $re]] ; then
      port=$default_port;
   else
      port=$new_port;
   fi
fi
params="";
for param in "$@"
do
   params+=" "$param;
done
re='admin';
if ! [[$params =~ $re]] ; then
   cmd=$nr_root"/node_modules/.bin/node-red -u "$nr_root" -p "$port;
else
   cmd=$nr_root"/node_modules/.bin/node-red"$params;
fi
#echo "cmd="$cmd;
exec $cmd

```

For yarn I just batch up a list of commands that I keep in 'yarn-init.sh'.

```auto
yarn add node@14.17.5
yarn add node-red@2.1.3
yarn add node-red-dashboard@3.1.0

```

---

<div class="post-metadata">

**Author:** ![mdkrieg](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mdkrieg/32/39091_2.png) [@mdkrieg](https://discourse.nodered.org/u/mdkrieg)\
**Post date:** [5 November 2021 19:32 UTC](https://discourse.nodered.org/t/portable-node-red-v2-1-3/53244/9 "2021-11-05T19:32:49Z")

</div>

> [@cymplecy](#):
>
> Apart from the exercise 🙂 any reason not to use Node-RED desktop?

The exercise was a big part of it which is why I took care to include a walkthrough in the repo.

For me the reason not to use something like Node-RED desktop is that I now use NR for many of the things I used to use Python for (in this case translating and XML database to a flat file) where I want to make a script and throw it in a drawer until I need it again. And in this case, NR beats the pants off python since all my dependencies are portable too 🙂

I think some would preach Docker here but I have zero experience with

---

<div class="post-metadata">

**Author:** ![mdkrieg](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mdkrieg/32/39091_2.png) [@mdkrieg](https://discourse.nodered.org/u/mdkrieg)\
**Post date:** [6 November 2021 15:24 UTC](https://discourse.nodered.org/t/portable-node-red-v2-1-3/53244/10 "2021-11-06T15:24:54Z")

</div>

### Update 1.1.0

Added configuration inputs to the initial screen, clicking START launches Node-RED:

 ![](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/9/e91fdb361712a58acc5e4965e6e49032d77bea90.png)

I'm very happy with this!

([nodered-portable download | SourceForge.net](https://sourceforge.net/projects/nodered-portable/))

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [6 November 2021 21:42 UTC](https://discourse.nodered.org/t/portable-node-red-v2-1-3/53244/11 "2021-11-06T21:42:54Z")

</div>

Downloaded and ran it -all looked good until I tried to install a node

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/1/917e5c17d4b1c54d25da27652b15f0648da59d83.png)

---

<div class="post-metadata">

**Author:** ![mdkrieg](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mdkrieg/32/39091_2.png) [@mdkrieg](https://discourse.nodered.org/u/mdkrieg)\
**Post date:** [8 November 2021 16:54 UTC](https://discourse.nodered.org/t/portable-node-red-v2-1-3/53244/12 "2021-11-08T16:54:53Z")

</div>

Yup, same problem for me when I decided to actually try installing from palette.

Luckily the solution was very simple. Node-RED was installing palette modules to the folder `"./home/node_modules"` and so while it was downloading the modules they weren't properly registering with NR. I changed the default settings from `userDir:"home"` to `userDir:"."` and it looks to be working now (I tested final portable file as well).

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/e/9e141bca9cdf90cc2ecd205b894b36fd9e0d4a2c.png)

(download latest file " nodered-portable-v1.1.1-win32-x64.zip" from same link above)

---

<div class="post-metadata">

**Author:** ![mweissen](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mweissen/32/51497_2.png) [@mweissen](https://discourse.nodered.org/u/mweissen)\
**Post date:** [24 November 2021 07:33 UTC](https://discourse.nodered.org/t/portable-node-red-v2-1-3/53244/13 "2021-11-24T07:33:56Z")

</div>

I have the same problem. Please tell me in which file you made this change. Or can you do it via the configuration menu? I have not found an entry.

---

<div class="post-metadata">

**Author:** ![mdkrieg](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mdkrieg/32/39091_2.png) [@mdkrieg](https://discourse.nodered.org/u/mdkrieg)\
**Post date:** [24 November 2021 15:24 UTC](https://discourse.nodered.org/t/portable-node-red-v2-1-3/53244/14 "2021-11-24T15:24:01Z")

</div>

Hello @mweissen and welcome to the forums. The palette modules not working should be fixed in the v1.1.1 version, it should download the latest automatically from sourceforge. I just deleted all the old versions anyway so you should be good if you just download again.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/6/36c7f1cefc1d288461d7acada848884c059a8328.png)

Let me know if the issue persists and I'll look into it.

---

<div class="post-metadata">

**Author:** ![mweissen](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mweissen/32/51497_2.png) [@mweissen](https://discourse.nodered.org/u/mweissen)\
**Post date:** [24 November 2021 16:26 UTC](https://discourse.nodered.org/t/portable-node-red-v2-1-3/53244/15 "2021-11-24T16:26:28Z")

</div>

Hello Matthew!

Thanks for the quick reply. First of all: now everything works.

Yesterday I tried first the version 1.1.1, but without success. So I tried it first with the older version - with the known problems. Now I have loaded the version 1.1.1 again and everything works. Thanks again!

I plan to give a workshop on home automation to teachers in April 2022. NodeRed is an interesting tool for this. For the practical exercises, nodered-portable is a very pratical tool. I will be happy to base the exercises on it.

Regards, Martin Weissenböck, Vienna, Austria

---

<div class="post-metadata">

**Author:** ![robgiov](https://avatars.discourse-cdn.com/v4/letter/r/b19c9b/32.png) [@robgiov](https://discourse.nodered.org/u/robgiov)\
**Post date:** [12 January 2022 09:23 UTC](https://discourse.nodered.org/t/portable-node-red-v2-1-3/53244/16 "2022-01-12T09:23:34Z")

</div>

Hello Matthew!

Good job!!

In this release how can I start nodered without pressing "START".  
I need to automatically start nodereded (with default port-httpAdminRoot-httpNodeRoot) when operating system starts.

Optionally, the (port-httpAdminRoot-httpNodeRoot) settings in which file can be changed?

Thanks in advance.

Roberto

---

<div class="post-metadata">

**Author:** ![PizzaProgram](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/pizzaprogram/32/19431_2.png) [@PizzaProgram](https://discourse.nodered.org/u/PizzaProgram)\
**Post date:** [16 January 2022 09:38 UTC](https://discourse.nodered.org/t/portable-node-red-v2-1-3/53244/17 "2022-01-16T09:38:25Z")

</div>

> [@robgiov](#):
>
> how can I start nodered without pressing "START".

That would interest me too 😉

---

<div class="post-metadata">

**Author:** ![paulkeates](https://avatars.discourse-cdn.com/v4/letter/p/9de053/32.png) [@paulkeates](https://discourse.nodered.org/u/paulkeates)\
**Post date:** [16 January 2022 17:15 UTC](https://discourse.nodered.org/t/portable-node-red-v2-1-3/53244/18 "2022-01-16T17:15:58Z")

</div>

Hi,

I believe that on the 'Inject' node there are options at the very bottom of the page. One of them is "inject once after X seconds" or similar....

I vaguely remember that with older version of node-red I used "npm install node-red-contrib-startup-trigger" that 'forced' the flow to ALWAYS start on deploy no matter what.

Cheers,

Paul

---

<div class="post-metadata">

**Author:** ![Jocman](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jocman/32/64370_2.png) [@Jocman](https://discourse.nodered.org/u/Jocman)\
**Post date:** [8 July 2022 14:33 UTC](https://discourse.nodered.org/t/portable-node-red-v2-1-3/53244/19 "2022-07-08T14:33:25Z")

</div>

Hi  
just downloaded the 1.1.1, as I'm starting to learn node red.  
Unfortunately I can't find the menu item Palette to get new nodes, but in all the pictures here in the post I can see the item is there....  
Do i something wrong?  
Thanks  
Andrea

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [8 July 2022 15:43 UTC](https://discourse.nodered.org/t/portable-node-red-v2-1-3/53244/20 "2022-07-08T15:43:38Z")

</div>

What does your screen look like when you click on the burger menu?

It should look like this

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/4/34709013b88a97fc930b1c684960098a32ead3a7.png)

[Next page](https://discourse.nodered.org/t/portable-node-red-v2-1-3/53244.md?page=2)
