# Node-RED integration to launch a container with one click

**URL:** <https://community.gladysassistant.com/t/integration-node-red-pour-lancer-un-container-en-un-clic/6584>\
**Category:** Demandes livrées\
**Tags:** feature-integration, node-red\
**Created:** [October 10, 2021, 7:52pm UTC](https://community.gladysassistant.com/t/integration-node-red-pour-lancer-un-container-en-un-clic/6584 "2021-10-10T19:52:29Z")\
**Posts on this page:** 20\
**Page:** 5

<div class="post-metadata">

**Author:** ![Psoy](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/psoy/32/9005_2.png) [@Psoy](https://community.gladysassistant.com/u/Psoy)\
**Post date:** [September 14, 2023, 9:19pm UTC](https://community.gladysassistant.com/t/integration-node-red-pour-lancer-un-container-en-un-clic/6584/81 "2023-09-14T21:19:59Z")

</div>

Okay, thanks for the info, can you just check if the command above is correct? Just a quick glance  
Thanks in advance

---

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [September 14, 2023, 9:26pm UTC](https://community.gladysassistant.com/t/integration-node-red-pour-lancer-un-container-en-un-clic/6584/82 "2023-09-14T21:26:31Z")

</div>

```auto
docker run -d \
--log-driver json-file \
--log-opt max-size=10m \
--cgroupns=host \
--restart=always \
--privileged \
--network=host \
--name gladys \
-e NODE_ENV=production \
-e SERVER_PORT=80 \
-e TZ=Europe/Paris \
-e SQLITE_FILE_PATH=/var/lib/gladysassistant/gladys-production.db \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /var/lib/gladysassistant:/var/lib/gladysassistant \
-v /dev:/dev \
-v /run/udev:/run/udev:ro \
gladysassistant/gladys:v4

```

Here is the official command from the docs, so apart from a few lines you’re good.  
Okay, you changed the name, the port, and the image name.

---

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [September 14, 2023, 9:31pm UTC](https://community.gladysassistant.com/t/integration-node-red-pour-lancer-un-container-en-un-clic/6584/83 "2023-09-14T21:31:22Z")

</div>

> [@Psoy](#):
>
> `/var/lib/gladysassistant_test_nodered`

Do you have this folder?

---

<div class="post-metadata">

**Author:** ![Psoy](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/psoy/32/9005_2.png) [@Psoy](https://community.gladysassistant.com/u/Psoy)\
**Post date:** [September 14, 2023, 9:31pm UTC](https://community.gladysassistant.com/t/integration-node-red-pour-lancer-un-container-en-un-clic/6584/84 "2023-09-14T21:31:32Z")

</div>

> [@\_Will\_71](#):
>
> Ok you changed the name, the port and the image name but is it your Pi or do you use Gladys every day?

No, it’s a different one, I installed the Gladys image with Raspberry Pi Imager and ran the command above. So there are

---

<div class="post-metadata">

**Author:** ![Psoy](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/psoy/32/9005_2.png) [@Psoy](https://community.gladysassistant.com/u/Psoy)\
**Post date:** [September 14, 2023, 9:33pm UTC](https://community.gladysassistant.com/t/integration-node-red-pour-lancer-un-container-en-un-clic/6584/85 "2023-09-14T21:33:18Z")

</div>

> [@\_Will\_71](#):
>
> Do you have this folder?

Yes, indeed, and inside I have this:

```auto
pi@gladys:/var/lib/gladysassistant_test_nodered $ ls
gladys-production.db gladys-production.db-shm gladys-production.db-wal homekit

```

---

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [September 14, 2023, 9:40pm UTC](https://community.gladysassistant.com/t/integration-node-red-pour-lancer-un-container-en-un-clic/6584/86 "2023-09-14T21:40:27Z")

</div>

I think the Node-RED folder is not in the right directory.

Remove your two containers gladys and gladys-test-nodered and also Node-RED, and then install @Lokkye’s image with the command below

```auto
docker run -d \
--log-driver json-file \
--log-opt max-size=10m \
--cgroupns=host \
--restart=always \
--privileged \
--network=host \
--name gladys \
-e NODE_ENV=production \
-e SERVER_PORT=80 \
-e TZ=Europe/Paris \
-e SQLITE_FILE_PATH=/var/lib/gladysassistant/gladys-production.db \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /var/lib/gladysassistant:/var/lib/gladysassistant \
-v /dev:/dev \
-v /run/udev:/run/udev:ro \
delogzway/gladys:nodered

```

Change the port if you want but not the path names. Then try to reinstall the Node-RED integration.

---

<div class="post-metadata">

**Author:** ![Psoy](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/psoy/32/9005_2.png) [@Psoy](https://community.gladysassistant.com/u/Psoy)\
**Post date:** [September 14, 2023, 9:43pm UTC](https://community.gladysassistant.com/t/integration-node-red-pour-lancer-un-container-en-un-clic/6584/87 "2023-09-14T21:43:02Z")

</div>

Okay, I’ll do that, it will take a little more time. Thanks for your help 👍

---

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [September 14, 2023, 9:46pm UTC](https://community.gladysassistant.com/t/integration-node-red-pour-lancer-un-container-en-un-clic/6584/88 "2023-09-14T21:46:44Z")

</div>

Normally it should be fast because there’s no need to re-download the Docker images  
keep us

---

<div class="post-metadata">

**Author:** ![Psoy](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/psoy/32/9005_2.png) [@Psoy](https://community.gladysassistant.com/u/Psoy)\
**Post date:** [September 14, 2023, 9:56pm UTC](https://community.gladysassistant.com/t/integration-node-red-pour-lancer-un-container-en-un-clic/6584/89 "2023-09-14T21:56:53Z")

</div>

I suspected something like that, that’s why I asked you to confirm my order. And indeed you are right , it works 🙏. Thank you for giving me your time. Have a good evening

---

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [September 14, 2023, 9:59pm UTC](https://community.gladysassistant.com/t/integration-node-red-pour-lancer-un-container-en-un-clic/6584/90 "2023-09-14T21:59:03Z")

</div>

With pleasure. Have a good evening.

@Lokkye, so maybe we should take into account if someone installs Gladys in a different directory, right?

---

<div class="post-metadata">

**Author:** ![Lokkye](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/lokkye/32/5881_2.png) [@Lokkye](https://community.gladysassistant.com/u/Lokkye)\
**Post date:** [September 15, 2023, 6:43am UTC](https://community.gladysassistant.com/t/integration-node-red-pour-lancer-un-container-en-un-clic/6584/91 "2023-09-15T06:43:25Z")

</div>

@Psoy : First of all, thank you for testing the Node-RED integration and sorry for the problem you encountered  
@_Will_71 : Thanks for the debugging, you were right about all your assumptions. And so yes, there is a problem with the path in the JSON to start Docker. I will fix that.

---

<div class="post-metadata">

**Author:** ![Psoy](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/psoy/32/9005_2.png) [@Psoy](https://community.gladysassistant.com/u/Psoy)\
**Post date:** [September 15, 2023, 7:51am UTC](https://community.gladysassistant.com/t/integration-node-red-pour-lancer-un-container-en-un-clic/6584/92 "2023-09-15T07:51:12Z")

</div>

> [@Lokkye](#):
>
> @Psoy: First of all, thanks for testing the Node-RED integration and sorry for the problem you encountered

Hello @Lokkye  
There is no problem, thanks to you for all this work that makes our lives easier 😉.  
For info I took a test example from a PR of RFLink and I changed the file names, I thought that the file names were independent

---

<div class="post-metadata">

**Author:** ![cce66](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/c/8797f3/32.png) [@cce66](https://community.gladysassistant.com/u/cce66)\
**Post date:** [September 15, 2023, 9:13am UTC](https://community.gladysassistant.com/t/integration-node-red-pour-lancer-un-container-en-un-clic/6584/93 "2023-09-15T09:13:34Z")

</div>

@Lokkye

[quote=«&nbsp;Psoy, post:62, topic:6584, full:true&nbsp;»]  
hello @c

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [September 15, 2023, 9:20am UTC](https://community.gladysassistant.com/t/integration-node-red-pour-lancer-un-container-en-un-clic/6584/94 "2023-09-15T09:20:53Z")

</div>

@Lokkye Thanks for the changes! I’ve left other comments on the PR :

> <https://github.com/GladysAssistant/Gladys/pull/1809#pullrequestreview-1628549997>
>
> \### Pull Request check-list
> 
> To ensure your Pull Request can be accepted as fa…st as possible, make sure to review and check all of these items:
> 
> \- \[x\] If your changes affects code, did your write the tests?
> \- \[x\] Are tests passing? (\`npm test\` on both front/server)
> \- \[x\] Is the linter passing? (\`npm run eslint\` on both front/server)
> \- \[x\] Did you run prettier? (\`npm run prettier\` on both front/server)
> \- \[x\] If you are adding a new features/services, did you run integration comparator? (\`npm run compare-translations\` on front)
> \- \[x\] Did you test this pull request in real life? With real devices? If this development is a big feature or a new service, we recommend that you provide a Docker image to \[the community\](https://community.gladysassistant.com/) for testing before merging.
> \- \[x\] If your changes modify the API (REST or Node.js), did you modify the API documentation? (Documentation is based on comments in code)
> 
> 
> \### Description of change
> Provide a new service to start node-red into docker and follow the status.
> 
> \<img width="366" alt="Screenshot 2023-06-08 at 15 11 38" src="https://github.com/GladysAssistant/Gladys/assets/11317212/3eacfb1a-4dee-450c-8fef-c72ed7fef718"\>
> \<img width="977" alt="Screenshot 2023-06-08 at 15 11 52" src="https://github.com/GladysAssistant/Gladys/assets/11317212/4358d321-a8db-426b-9feb-d4e193acf6ee"\>

For me, we’re good on functionality. Once the stability fixes and my PR feedback are OK, it’s good to go to production 🙂

> [@cce66](#):
>
> Not possible to let the user choose the port in the case where there is no other Node-RED Docker container using port 1880

For a first development, I think we’re good in terms of functionality. Once the stability fixes and my technical feedback are addressed, for me we can go to production as-is.

---

<div class="post-metadata">

**Author:** ![cce66](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/c/8797f3/32.png) [@cce66](https://community.gladysassistant.com/u/cce66)\
**Post date:** [September 15, 2023, 9:57am UTC](https://community.gladysassistant.com/t/integration-node-red-pour-lancer-un-container-en-un-clic/6584/95 "2023-09-15T09:57:34Z")

</div>

@pierre-gilles

> [@pierre-gilles](#):
>
> For a first development, I think we’re good in terms of functionality. Once the stability fixes and my technical feedback are addressed, for me we can go to production as is.

Totally

---

<div class="post-metadata">

**Author:** ![Lokkye](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/lokkye/32/5881_2.png) [@Lokkye](https://community.gladysassistant.com/u/Lokkye)\
**Post date:** [September 19, 2023, 6:49am UTC](https://community.gladysassistant.com/t/integration-node-red-pour-lancer-un-container-en-un-clic/6584/96 "2023-09-19T06:49:08Z")

</div>

@pierre-gilles: I just pushed the fix for the feedback you gave me on the PR as well as the fix for the configuration folder issue.

> [@cce66](#):
>
> Once again, congrats and thanks to @Lokkye for the work done! 👍 👏

@cce66: Thanks 🙂

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [September 20, 2023, 5:00pm UTC](https://community.gladysassistant.com/t/integration-node-red-pour-lancer-un-container-en-un-clic/6584/97 "2023-09-20T17:00:16Z")

</div>

Thanks @Lokkye ! 🙏

@Psoy can you retest and check that it’s OK?

---

<div class="post-metadata">

**Author:** ![Psoy](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/psoy/32/9005_2.png) [@Psoy](https://community.gladysassistant.com/u/Psoy)\
**Post date:** [September 20, 2023, 7:10pm UTC](https://community.gladysassistant.com/t/integration-node-red-pour-lancer-un-container-en-un-clic/6584/98 "2023-09-20T19:10:39Z")

</div>

> [@pierre-gilles](#):
>
> @Psoy can you retest and check that it’s okay?

Good evening,  
I tested with my command (where I modified the filenames myself), here is that command

```auto
docker run -d \
--log-opt max-size=10m \
--restart=always \
--privileged \
--network=host \
--name gladys-test-nodered \
-e NODE_ENV=production \
-e SERVER_PORT=8001 \
-e TZ=Europe/Paris \
-e SQLITE_FILE_PATH=/var/lib/gladysassistant/gladys-production.db \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /var/lib/gladysassistant_test_nodered:/var/lib/gladysassistant \
-v /dev:/dev \
-v /run/udev:/run/udev:ro \
delogzway/gladys:nodered

```

I still have the same problem. Everything goes well up to this point:

 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/e/e14c34eebc4bfb7d205d95c52207050bdea85a7b.png)

Then when I click on the Node-RED interface link, the connection fails

```auto
La connexion a échoué

Firefox ne peut établir de connexion avec le serveur à l’adresse 192.168.1.136:1881.

    Le site est peut-être temporairement indisponible ou surchargé. Réessayez plus tard ;
    Si vous n’arrivez à naviguer sur aucun site, vérifiez la connexion au réseau de votre ordinateur ;
    Si votre ordinateur ou votre réseau est protégé par un pare-feu ou un proxy, assurez-vous que Firefox est autorisé à accéder au Web.

```

**But well, since it’s a filename problem (created by myself) on a test image, I don’t know if it’s worth dwelling on it much more.**

Here are the logs anyway

```auto

2023-09-20T20:43:01+0200 <info> checkForContainerUpdates.js:13 (NodeRedManager.checkForContainerUpdates) Node-RED: Checking for current installed versions and required updates...
2023-09-20T20:43:01+0200 <info> checkForContainerUpdates.js:17 (NodeRedManager.checkForContainerUpdates) Node-RED: update #2 of the container required...
2023-09-20T20:43:01+0200 <info> checkForContainerUpdates.js:34 (NodeRedManager.checkForContainerUpdates) Node-RED: update #2 of the container done
2023-09-20T20:43:01+0200 <info> installContainer.js:44 (NodeRedManager.installContainer) Nodered: is being installed as Docker container...
2023-09-20T20:43:01+0200 <info> installContainer.js:45 (NodeRedManager.installContainer) Pulling nodered/node-red:3.1 image...
2023-09-20T20:43:03+0200 <info> installContainer.js:49 (NodeRedManager.installContainer) Nodered: Preparing environment...
2023-09-20T20:43:03+0200 <info> configureContainer.js:16 (NodeRedManager.configureContainer) Node-RED: Docker container is being configured...
2023-09-20T20:43:03+0200 <info> configureContainer.js:36 (NodeRedManager.configureContainer) Node-RED: Writing default configuration...
2023-09-20T20:43:03+0200 <info> installContainer.js:52 (NodeRedManager.installContainer) Creation of container...
2023-09-20T20:43:05+0200 <info> installContainer.js:57 (NodeRedManager.installContainer) Node-RED: successfully installed and configured as Docker container
2023-09-20T20:43:05+0200 <info> configureContainer.js:16 (NodeRedManager.configureContainer) Node-RED: Docker container is being configured...
2023-09-20T20:43:05+0200 <info> configureContainer.js:34 (NodeRedManager.configureContainer) Node-RED: configuration file already exists.
2023-09-20T20:43:05+0200 <info> installContainer.js:80 (NodeRedManager.installContainer) Node-RED: container is (re)starting...
2023-09-20T20:43:12+0200 <info> installContainer.js:86 (NodeRedManager.installContainer) Node-RED: container successfully started

```

All I have to do is change the filename gladysassistant\_test\_nodered:

```auto
`-v /var/lib/gladysassistant_test_nodered:/var/lib/gladysassistant \`

```

to

```auto
-v /var/lib/gladysassistant:/var/lib/gladysassistant \

```

for everything to work.  
Thanks to @_Will_71 who shed light on this problem 😉

---

<div class="post-metadata">

**Author:** ![cce66](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/c/8797f3/32.png) [@cce66](https://community.gladysassistant.com/u/cce66)\
**Post date:** [September 20, 2023, 7:36pm UTC](https://community.gladysassistant.com/t/integration-node-red-pour-lancer-un-container-en-un-clic/6584/99 "2023-09-20T19:36:57Z")

</div>

You should try another browser or clear Firefox’s cache and check about:logins to see if there are any saved credentials (I had an issue with the MQTT credentials because the fields were autofilled and Firefox replaced them on the fly without indicating it).

---

<div class="post-metadata">

**Author:** ![Psoy](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/psoy/32/9005_2.png) [@Psoy](https://community.gladysassistant.com/u/Psoy)\
**Post date:** [September 20, 2023, 8:50pm UTC](https://community.gladysassistant.com/t/integration-node-red-pour-lancer-un-container-en-un-clic/6584/100 "2023-09-20T20:50:17Z")

</div>

Good evening @cce66  
I started from a fresh install and reinstalled everything with the following command :

```auto
docker run -d \
--log-opt max-size=10m \
--restart=always \
--privileged \
--network=host \
--name gladys-test-nodered \
-e NODE_ENV=production \
-e SERVER_PORT=8010 \
-e TZ=Europe/Paris \
-e SQLITE_FILE_PATH=/var/lib/gladysassistant/gladys-production.db \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /var/lib/gladysassistant_test_nodered:/var/lib/gladysassistant \
-v /dev:/dev \
-v /run/udev:/run/udev:ro \
delogzway/gladys:nodered

```

and it’s the same result on Chrome, the connection to Node-RED on port 1881 fails:

```auto
Ce site est inaccessible192.168.1.136 n'autorise pas la connexion.
Voici quelques conseils :

Vérifier la connexion
Vérifier le proxy et le pare-feu
ERR_CONNECTION_REFUSED

```

this is the line that’s causing the problem :

```auto
-v /var/lib/gladysassistant_test_nodered:/var/lib/gladysassistant \

```

you need to remove the **\_test\_nodered**

[Previous page](https://community.gladysassistant.com/t/integration-node-red-pour-lancer-un-container-en-un-clic/6584.md?page=4)

[Next page](https://community.gladysassistant.com/t/integration-node-red-pour-lancer-un-container-en-un-clic/6584.md?page=6)
