Migrate from installed 0.19 to dockerized 1.0.3

Can't seem to identify my problem here.

I ran NodeRed 0.19.2 so far, which I installed 2 yrs or so ago. I do not remember any details of the installation process and actually the node.js thing is also a black box to me.

I thought I'd try nodered docker container for once as I used (really just used) some other Docker containers recently.

Getting the Node-Red v1.0.3 docker container running is easy.

I can even run my old NodeRed and the new one in parallel using different ports.

I have backed up ~/.node-red to save all my flows, just in case, but kept the folder as it is - mostly (see below). Now i actually just want to simply run:

docker run -it -p 1880:1880 -v /home/sebastian/.node-red/:/data/ --name mynodered nodered/node-red

As shown in the documentation, using the -v parameter to tell Docker to map the old Node-Red datapath containing configuration and flows to the docker container and use it.

When i started the docker container first it complained that credentials have been crypted with a host secret and i shall use a secret in the config file to be able to use the settings. Thats why i think the mapping of the folder is correct.

However, after I set a secret in the settings, restarted my old nodered (just to make sure it will re-crypt the stored credentials) and then stopped it and started the docker container again, the flows are not shown in the WebUi.

Also I chown'ed the settings folder to 1000:1000 as I read somewhere.

How can I smoothly transfer my flows to the dockerized NodeRed. It must be possible, but probably I forgot one tiny detail. Any obvious mistakes? I can't find any hints how to migrate to dockerized nodered. Thanks for your help!

What does the docker log show you ?

docker logs -f mynodered

Is there a specific reason why you want to use docker for node-red ?

Thanks for your response!

Actually, docker logs shows exactly the console output i have seen.

But your question has made me review it once more and i saw the following line

17 Dec 19:31:10 - [info] Flows file     : /data/flows.json

I noticed that the old flow file is actually


Maybe the docker container does not really know or care about the hosts hostname and does not use it for the flows file.

I renamed the file and now it loads...

The reason i thought I'd try the docker is to not care about node.js or any other dependencies.

Would you suggest to not use docker?

Now i have all my flows - but I can not deploy them due to the following warning

Flows stopped due to missing node types.

    e-mail in
    xmpp out
    xmpp in
    influxdb out

So altough all the nodes were somehow available and showing up in "manage palette", it seems to be caused by the fact i hadn't copied the node-modules into the new directory that i mapped into the container (i just copied the flows and settinsg).

I copied the nodes and now only these things fail

17 Dec 19:38:16 - [info] Waiting for missing types to be registered:
17 Dec 19:38:16 - [info]  - e-mail in (provided by npm module node-red-node-email)
17 Dec 19:38:16 - [info]  - e-mail (provided by npm module node-red-node-email)
17 Dec 19:38:16 - [info] To install any of these missing modules, run:
17 Dec 19:38:16 - [info]   npm install <module name>
17 Dec 19:38:16 - [info] in the directory:
17 Dec 19:38:16 - [info]   /data

How do i npm install something in a docker container?

Actually: i have just found out that email and email-in can be installed via the "manage palette" menu. I do not need to run any npm commands.

So this leaves only:

Coming back to the question if it is recommended at all - I thought if a project offers and advertises the docker container it is somehow advised/promoted to use it....


somehow advised/promoted to use it

Is it ? There are many paths to Rome and docker is one of them.
Don't get me wrong docker is fantastic, but it can introduce issues as well, especially if you want to use things like tcp/udp/serial or certain nodes that require compiling.

Yeah.... I already learnt how to bash/attach into a running docker to create new keys in ~/.ssh to make my flow that calls a script via ssh work again :wink:
Also all "localhost" nodes (mqtt, influxdb, etc.) needed adaption...

So it also adds complexity that is for sure.

I'll just try to keep it running now and see. My NodeRed is business but not life critical. I want it up and running, but i'm happy to tinker with it and learn something new (which i did today, definitely).

I'm not really sure if i can back the claim that projects encourage (i think that was the word i was looking for in my last post) to use docker, but often it is mentioned first before the manual installation process.

Lets see :slight_smile:

1 Like

We recommend people run Node-RED in the manner in which they are most comfortable. If you are familiar and happy with docker then great, if not then it's one more thing to have to get to grips with as it does add some more little wrinkles into the mix.