NODE-RED and MOSQUITTO docker-compose

Hi,
I've googled looking for docker compose with node-red and mosquitto, but I can't use properly.
Someone has the example?

Thanks

this works for me

services:
  node-red:
    image: nodered/node-red:latest
    restart: unless-stopped
    environment:
      - TZ=Europe/London
    networks:
      - node-red-net
    ports:
      - "1880:1880"
    volumes:
      - node-red-data:/data

  MQTTbroker:
    image: eclipse-mosquitto:1.6.13
    restart: unless-stopped
    networks:
      - node-red-net

volumes:
  node-red-data:

networks:
  node-red-net:

Hi @dceejay
Thaks a lot for share.

what broker server ip did you insert into connection tab of mqtt broker?

in my case never shown connected. :slightly_frowning_face:


image

The name it was called in the compose file. MQTTbroker

1 Like

I'm facing the same status from mqtt node "conecting".

  • I've tagged my MQTTbroker services to version 1.6.13 on docker compose file;
  • and tryied service name (MQTTbroker, localhost, container IP) for mqtt connection

none of above options succed. :frowning:

can you get a terminal session into the node-red container and then try pinging the other.
I use Portainer to manage them so it's easy but command line like

docker exec -it cp_node-red_1 /bin/bash

should work

where cp_node-red_1 comes from when you do docker-compose up and get

$ docker-compose up
Starting cp_MQTTbroker_1 ... done
Starting cp_node-red_1   ... done
Attaching to cp_MQTTbroker_1, cp_node-red_1

Nice @dceejay.
I did exactly what you said and it works for me also.

I tried remake the step-by-step of mosquitto configuration, but this turn I switched anonimous false to anonimous true and got connected.
Do you know how could I secure mqtt connection?
I used the tutorial (method 1) below. Do you have any concerns?

Thanks a lot for all help until here.

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