# How to "npm install" to a red-node in a docker?

**URL:** <https://discourse.nodered.org/t/how-to-npm-install-to-a-red-node-in-a-docker/72555>\
**Category:** General\
**Tags:** docker\
**Created:** [21 December 2022 22:14 UTC](https://discourse.nodered.org/t/how-to-npm-install-to-a-red-node-in-a-docker/72555 "2022-12-21T22:14:46Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![AndKe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andke/32/73023_2.png) [@AndKe](https://discourse.nodered.org/u/AndKe)\
**Post date:** [21 December 2022 22:14 UTC](https://discourse.nodered.org/t/how-to-npm-install-to-a-red-node-in-a-docker/72555/1 "2022-12-21T22:14:47Z")

</div>

My red-node is run via docker.  
Then I see this addon: [node-red-contrib-zigbee2mqtt (node) - Node-RED](https://flows.nodered.org/node/node-red-contrib-zigbee2mqtt)

- "npm install" is certainly not something I can do in shell .. so where does this command go?

---

<div class="post-metadata">

**Author:** ![Buckskin](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@Buckskin](https://discourse.nodered.org/u/Buckskin)\
**Post date:** [21 December 2022 22:23 UTC](https://discourse.nodered.org/t/how-to-npm-install-to-a-red-node-in-a-docker/72555/2 "2022-12-21T22:23:50Z")

</div>

You are better off just using standard MTTQ nodes

---

<div class="post-metadata">

**Author:** ![AndKe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andke/32/73023_2.png) [@AndKe](https://discourse.nodered.org/u/AndKe)\
**Post date:** [21 December 2022 22:25 UTC](https://discourse.nodered.org/t/how-to-npm-install-to-a-red-node-in-a-docker/72555/3 "2022-12-21T22:25:33Z")

</div>

thanks, by any chance, are you aware of a suitable example/tutorial/guide ?

---

<div class="post-metadata">

**Author:** ![tve](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tve/32/59475_2.png) [@tve](https://discourse.nodered.org/u/tve)\
**Post date:** [22 December 2022 00:08 UTC](https://discourse.nodered.org/t/how-to-npm-install-to-a-red-node-in-a-docker/72555/4 "2022-12-22T00:08:14Z")

</div>

My FlexDash docs have quite an extensive how-to for docker. Obviously it's geared towards FlexDash but it's really all about installing packages. But it may be more complexity than you want to deal with... [Docker - FlexDash](https://flexdash.github.io/docs/quick-start/docker/)

---

<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:** [22 December 2022 07:19 UTC](https://discourse.nodered.org/t/how-to-npm-install-to-a-red-node-in-a-docker/72555/5 "2022-12-22T07:19:22Z")

</div>

> [@AndKe](#):
>
> are you aware of a suitable example/tutorial/guide ?

A guide for what in particular?

If you mean information about mqtt then see this tutorial [MQTT Essentials - All Core Concepts Explained](https://www.hivemq.com/mqtt-essentials/)

If you mean specifically about using it with zigbee2mqtt then the best thing to do is to install mqttexplorer on a pc on your network and then you can look to see what mqtt topics your devices use so you can easily access then from node red.

---

<div class="post-metadata">

**Author:** ![lu4t](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lu4t/32/32276_2.png) [@lu4t](https://discourse.nodered.org/u/lu4t)\
**Post date:** [22 December 2022 07:20 UTC](https://discourse.nodered.org/t/how-to-npm-install-to-a-red-node-in-a-docker/72555/6 "2022-12-22T07:20:55Z")

</div>

First off, you need to open a shell on the container:

> docker exec -it name\_of\_node-red\_docker /bin/bash

Then, from within the running container, you go to the user dir you mapped when the container was launched, typically `/data`  
Inside you will have a node\_modules directory, you cd into it, and run:

> npm i node-red-contrib-zigbee2mqtt

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [20 February 2023 07:21 UTC](https://discourse.nodered.org/t/how-to-npm-install-to-a-red-node-in-a-docker/72555/7 "2023-02-20T07:21:49Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
