# Can't connect to any MQTT broker

**URL:** <https://discourse.nodered.org/t/cant-connect-to-any-mqtt-broker/14013>\
**Category:** General\
**Created:** [5 August 2019 09:48 UTC](https://discourse.nodered.org/t/cant-connect-to-any-mqtt-broker/14013 "2019-08-05T09:48:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![titouanlh](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/titouanlh/32/10652_2.png) [@titouanlh](https://discourse.nodered.org/u/titouanlh)\
**Post date:** [5 August 2019 09:48 UTC](https://discourse.nodered.org/t/cant-connect-to-any-mqtt-broker/14013/1 "2019-08-05T09:48:11Z")

</div>

Hi everyone !  
I am trying to connect to my MQTT broker from Node-RED.  
I have RabbitMQ installed with MQTT plugin activated. It is listening on port 1883. When I trie to connect to it with an MQTT node, I get this error in Node-RED's logs :

```auto
[mqtt-broker:11b4b29f.2e05fd] Connection failed to broker: mqtt://10.8.0.1:1883

```

In the same time, Node-RED is connected with RabbitMQ with AMQP node and this is working fine.  
So I tried to connect Node-RED to public brokers ([iot.eclipse.org](http://iot.eclipse.org), [test.mosquitto.org](http://test.mosquitto.org),...) but I always get the same error, so I think the issue comes from Node-RED...  
Do you know a way to fix this ?

(I have everything running in Docker and using nodered/node-red-docker:rpi-v8 image)

Thank's 🙂

[UPDATE]  
I installed a Mosquitto broker on another local machine (10.8.0.6) and it worked with Node-RED.  
But why doesn't it work with remote brokers nor RabbitMQ broker ?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [5 August 2019 12:13 UTC](https://discourse.nodered.org/t/cant-connect-to-any-mqtt-broker/14013/3 "2019-08-05T12:13:42Z")

</div>

Sounds like this will be a firewall issue. Check any firewalls between Node-RED and the public brokers and make sure that outbound port 1883 is open.
