# Run NR in Docker Container or Virtual Machine?

**URL:** <https://discourse.nodered.org/t/run-nr-in-docker-container-or-virtual-machine/13771>\
**Category:** Hardware\
**Created:** [28 July 2019 10:26 UTC](https://discourse.nodered.org/t/run-nr-in-docker-container-or-virtual-machine/13771 "2019-07-28T10:26:31Z")\
**Posts on this page:** 9\
**Page:** 2

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [29 July 2019 16:08 UTC](https://discourse.nodered.org/t/run-nr-in-docker-container-or-virtual-machine/13771/21 "2019-07-29T16:08:42Z")

</div>

> [@nodecentral](#):
>
> take it this is not an option, no way to wrap the install for use in the NR container

No. The palette manager can only be used to install npm modules that have been listed in the flow library.

> [@nodecentral](#):
>
> Just curious how the existing NR add-on's that provide ffmpeg capabilities have done it ?

Which ones in particular? You'd have to dig into them to find out. They may simply require you to have ffmpeg preinstalled.

---

<div class="post-metadata">

**Author:** ![tbdltee](https://avatars.discourse-cdn.com/v4/letter/t/7cd45c/32.png) [@tbdltee](https://discourse.nodered.org/u/tbdltee)\
**Post date:** [30 July 2019 01:55 UTC](https://discourse.nodered.org/t/run-nr-in-docker-container-or-virtual-machine/13771/22 "2019-07-30T01:55:23Z")

</div>

I also consider NR on docker for a while and decide not to use it. My app is the IOT which using 1 NR for back-end and 2 node-red-dashboard front-end. They are having different setting.js. So using docker is difficult to setup (when port to new host). Docker is good if you have the same setup for multiple containers.

I'm using 3 NR instances running on the same VM. I'm control the NR instance using PM2. All 3 NR share the same static http folder and data file.  
I'm just created a new node-red folder, copy only setting.js to those folders and use command:

node -s /home//node-red1/settings.js -u /home//node-red1  
node -s /home//node-red2/settings.js -u /home//node-red2  
node -s /home//node-red3/settings.js -u /home//node-red3

NR will copied itself to each folder. Each NR will run separately. That means you need to add paletted of each NR.  
Of course, setting.js in each folder is using different port.

---

<div class="post-metadata">

**Author:** ![nodecentral](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nodecentral/32/10432_2.png) [@nodecentral](https://discourse.nodered.org/u/nodecentral)\
**Post date:** [30 July 2019 08:32 UTC](https://discourse.nodered.org/t/run-nr-in-docker-container-or-virtual-machine/13771/23 "2019-07-30T08:32:53Z")

</div>

Welcome, @tbdltee

I’m afraid you lost me on much of that, but it sounds impressive 👍

---

<div class="post-metadata">

**Author:** ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)\
**Post date:** [30 July 2019 09:04 UTC](https://discourse.nodered.org/t/run-nr-in-docker-container-or-virtual-machine/13771/24 "2019-07-30T09:04:27Z")

</div>

Are you talking about running the VM on your NAS ? Initially i would not do that - for the very reasons you have mentioned - simplify - run it on your PC first in a virtual machine and then later migrate to your NAS (which probably requires license keys for virtualisation)

Craig

---

<div class="post-metadata">

**Author:** ![nodecentral](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nodecentral/32/10432_2.png) [@nodecentral](https://discourse.nodered.org/u/nodecentral)\
**Post date:** [30 July 2019 09:11 UTC](https://discourse.nodered.org/t/run-nr-in-docker-container-or-virtual-machine/13771/25 "2019-07-30T09:11:28Z")

</div>

All VMs and Containers are handled on my qnap , it’s pretty straight forward, and I’ve had no issues with performance or licensing...

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/8/8563a71b38964c36e05a34d4bb5bd397ac11adba.jpeg)

You can check out the fun i’m having with installing a Debian vm for Node Red here - \> [NR Install Script - “Failed to install node.js” error](https://discourse.nodered.org/t/nr-install-script-failed-to-install-node-js-error/13813)

---

<div class="post-metadata">

**Author:** ![tbdltee](https://avatars.discourse-cdn.com/v4/letter/t/7cd45c/32.png) [@tbdltee](https://discourse.nodered.org/u/tbdltee)\
**Post date:** [30 July 2019 10:29 UTC](https://discourse.nodered.org/t/run-nr-in-docker-container-or-virtual-machine/13771/26 "2019-07-30T10:29:57Z")

</div>

I think you've already been decided to walk through to the docker path. So, there is no point to compare VM vs docker anymore.  
Docker is using micro-service concept. I myself personally would like to use standard NR container package. Thus, I would consider to create ffmpeg as another container and communicated to the existing NR containers using TCP.  
So you will have ffmeg micro-service, NR dashboard micro-services. and they are talking to each others.

---

<div class="post-metadata">

**Author:** ![nodecentral](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nodecentral/32/10432_2.png) [@nodecentral](https://discourse.nodered.org/u/nodecentral)\
**Post date:** [30 July 2019 10:37 UTC](https://discourse.nodered.org/t/run-nr-in-docker-container-or-virtual-machine/13771/27 "2019-07-30T10:37:33Z")

</div>

I'm still progressing with the Debian VM running NR, as I'm intrigued how well that works, but your comment (extracted/trimmed below) is of interest.

> [@tbdltee](#):
>
> ...have ffmeg micro-service, NR dashboard micro-services. .... talking to each others

How do you do that ?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [30 July 2019 10:52 UTC](https://discourse.nodered.org/t/run-nr-in-docker-container-or-virtual-machine/13771/28 "2019-07-30T10:52:31Z")

</div>

> [@tbdltee](#):
>
> So you will have ffmeg micro-service, NR dashboard micro-services. and they are talking to each others.

What you describe is a lot of extra work for very little benefit. ffmpeg isn't a service you run. It is a command-line utility you can call to do stuff. To create a micro-service from it would take a bunch of code to run, listening for requests, running them and passing back the result.

That really is overkill when all you need to do is build one container with node-red and ffmpeg installed and use the exec node in node-red to call ffmpeg.

Ultimately it's up to @nodecentral on the approach he takes. He has to decide if creating a three line Dockerfile is more work than creating multiple Dockerfiles and services within them and joining them all together.

---

<div class="post-metadata">

**Author:** ![tbdltee](https://avatars.discourse-cdn.com/v4/letter/t/7cd45c/32.png) [@tbdltee](https://discourse.nodered.org/u/tbdltee)\
**Post date:** [30 July 2019 12:37 UTC](https://discourse.nodered.org/t/run-nr-in-docker-container-or-virtual-machine/13771/29 "2019-07-30T12:37:28Z")

</div>

I agree. If his work is stoped at 3 containers, it would be OK to build ffmeg inside them. I just think of a big system which built everything with micro-service concept.  
However, it's better to keep it simple.  
Maybe it has another way like create an watched folder for ffmpeg on host and share this folder amoung all NR containers.

[Previous page](https://discourse.nodered.org/t/run-nr-in-docker-container-or-virtual-machine/13771.md?page=1)
