# Unable to install node red using docker command

**URL:** <https://discourse.nodered.org/t/unable-to-install-node-red-using-docker-command/18147>\
**Category:** General\
**Created:** [19 November 2019 13:05 UTC](https://discourse.nodered.org/t/unable-to-install-node-red-using-docker-command/18147 "2019-11-19T13:05:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dineshpittala](https://avatars.discourse-cdn.com/v4/letter/d/85f322/32.png) [@dineshpittala](https://discourse.nodered.org/u/dineshpittala)\
**Post date:** [19 November 2019 13:05 UTC](https://discourse.nodered.org/t/unable-to-install-node-red-using-docker-command/18147/1 "2019-11-19T13:05:28Z")

</div>

linux@linux-VirtualBox:~/node$  
linux@linux-VirtualBox:~/node$ docker run -it -p 1880:1880 --name mynodered\*\* nodered/node-red  
fs.js:114  
throw err;  
^

Error: EACCES: permission denied, open '/usr/local/lib/node\_modules/npm/bin/npm-cli.js'  
at Object.openSync (fs.js:443:3)  
at Object.readFileSync (fs.js:343:35)  
at Object.Module.\_extensions..js (internal/modules/cjs/loader.js:788:20)  
at Module.load (internal/modules/cjs/loader.js:653:32)  
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)  
at Function.Module.\_load (internal/modules/cjs/loader.js:585:3)  
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)  
at startup (internal/bootstrap/node.js:283:19)  
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)  
linux@linux-VirtualBox:~/node$ npm -v  
3.5.2  
linux@linux-VirtualBox:~/node$  
linux@linux-VirtualBox:~/node$

can you pls help on the above error  
I am trying on Ubuntu.

---

<div class="post-metadata">

**Author:** ![michaelblight](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/michaelblight/32/445_2.png) [@michaelblight](https://discourse.nodered.org/u/michaelblight)\
**Post date:** [20 November 2019 02:40 UTC](https://discourse.nodered.org/t/unable-to-install-node-red-using-docker-command/18147/2 "2019-11-20T02:40:42Z")

</div>

Put `sudo` out the front to avoid permission issues. Or setup the user to not require sudo when running docker.

`sudo docker run -it -p 1880:1880 --name mynodered** nodered/node-red`

Also, I'm not sure about those asterisks in the name, particularly without quotes around the whole thing.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [20 November 2019 07:16 UTC](https://discourse.nodered.org/t/unable-to-install-node-red-using-docker-command/18147/3 "2019-11-20T07:16:34Z")

</div>

In addition don't use docker unless you have a good reason to do that.

---

<div class="post-metadata">

**Author:** ![bohtho](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bohtho/32/6153_2.png) [@bohtho](https://discourse.nodered.org/u/bohtho)\
**Post date:** [20 November 2019 08:16 UTC](https://discourse.nodered.org/t/unable-to-install-node-red-using-docker-command/18147/4 "2019-11-20T08:16:03Z")

</div>

That’s interesting and I fear may start a flame war, but I’ve felt so oldschool because I’ve ever only tested docker on my Mac once and run everything on all my rpi3bs with just DietPi as OS and normal installations.

I hear people rave about the encapsulation and ease of updating etc when running docker for each app, but I fear the overhead and the network issues.

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [20 November 2019 09:07 UTC](https://discourse.nodered.org/t/unable-to-install-node-red-using-docker-command/18147/5 "2019-11-20T09:07:15Z")

</div>

Docker containers are fantastic, but are note that they are "containers", meaning it is meant to run on its own.

Node-red can ofcourse be run fine in a container, but once you need to break out of that container, it can become a burden. Let's say you want to use an exec node, any command not available in the container will not work and installing is no option, you will need to recreate the container including the command, and repeat where needed. Same applies to using tcp/udp ports which need to be mapped to the container.

I personally believe that node-red in docker can create more potential problems than it solves.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [20 November 2019 09:07 UTC](https://discourse.nodered.org/t/unable-to-install-node-red-using-docker-command/18147/6 "2019-11-20T09:07:31Z")

</div>

I don't think you will start a flame war. Docker may well be appropriate for some things but you only have to search the forum here to see the problems others have had using it with node-red. I suspect the main issue is that node red often requires access to assorted system resources and so may not be ideally suited to being run in Docker.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [20 November 2019 10:34 UTC](https://discourse.nodered.org/t/unable-to-install-node-red-using-docker-command/18147/7 "2019-11-20T10:34:59Z")

</div>

@Colin - I think @bohtho was referring to you starting the flame war 🙂 - Docker is a perfectly fine way to run Node-RED (over 1 million downloads since 1.0 can't be wrong...) - but as @bakman2 points out the clue is in the word container. If the user understands Docker then adding Node-RED to it is usually not a problem. The trouble often comes if the user is new to both.

Back to the OP - I don't think those \*\* are a good idea - but the error does look very odd - no idea why the docker command should be calling npm in that manner - I would expect more output like can't file local image - fetching etc... so yes the question is - is the OP trying to run docker for fun and education to try it out ? or would a normal install of Node-RED be perfectly fine - in which case the recommended install script from the docs is the way to go
