MQTT Brokers/Servers and Cloud Hosting Guide

mqtt-brokersWhen it comes to hosting an MQTT broker/server you have three main options:

  • Use you Own Locally Installed Server
  • Use a Cloud Based Sever or Virtual Server
  • Use a Shared Server Application

Own Server Locally Installed

You can install an MQTT broker on your own server hardware.

There are many brokers/servers to choose from and most are free and open source.

Each of these brokers will have their own requirements e.g Mosca is Node.js based and so requires node.js to be installed.

Broker Description
Mosquitto Lightweight open source broker written in C. Probably the most popular MQTT broker. Website

Install instructions Windows and Linux

Mosca Mosca is Node.js based and so requires node.js to be installed.See GitHub

It can also be installed as a node in node-red.

It is not very feature rich when compared to mosquitto.


Written in Erlang is Open Source and described as massively scalable. EMQ Implements both MQTT V3.1 and V3.1.1 protocol specifications, and supports MQTT-SN, CoAP, WebSocket, STOMP . See Github
Python Test Broker Python test brokers including MQTT v5
VerneMQ Written in Erlang and supporting clustering.

Note: Comprehensive comparison list on wiki

The problem with this arrangement is that you are responsible for the installation, and maintenance of the hardware and software.

This is likely to be the main choice for local MQTT applications.

Mosquitto vs Mosca for Learning and Testing

If you are just getting started with MQTT and you are also using node-red then you might want to use the mosca broker.

Mosca is a very simple broker and ideal for small home network deployments and for learning MQTT.

It is installed as a node-red node and then added to a flow.

Mosca does support websockets but not SSL. It also supports basic username/password authentication.

Note: Many of the cloud based MQTT service providers also use these brokers.

Virtual Server

These are available from many providers and are currently mainly used for website hosting.

However they can be used for hosting any web application, and will be a popular choice for hosting Node.js and MQTT.

With this type of hosting you aren’t responsible for the hardware, but software install and management is your responsibility.

Online or cloud based MQTT servers/brokers are likely to be used for connecting different physical geographic locations together.

Google, Amazon, Microsoft, IBM and many others provide cloud based hosting.

Managed MQTT Servers/Brokers- Cloud Hosting

This is similar to cloud servers except you are limited to hosting a single application- MQTT.

This is the way present day websites are hosted.

This form of hosting is preferred for small organisations as the software install and maintenance is done by the hosting company.

Just as with standard web hosting there are likely to be a wide range of options available for MQTT hosting

Because the market is still very new there are very few dedicated commercial MQTT hosting providers.

Here are the ones I am currently aware of.

Cloudmqtt is offering production mqtt options all of the others are focused on testing. See Creating an MQTT Broker With CloudMQTT and this video

flespi is a new online broker offering free MQTT broker service and support MQTT v5. Currently there doesn’t appear to be a paid option. offers MQTT services and REST API support. It has lots of plans, including a free option, and also offers online message storage.

Online Test Brokers

These brokers  are used for testing MQTT but a view offer commercial packages.

 Online Cloud Base MQTT Brokers/Servers

Broker Type Broker Address and Port Websocket Support SSL support



Encrypted port 8081

Un-encrypted 8080

Yes 8883 With Client certificate 8884




Mosquitto  Yes

80 and 443 (SSL)





Moving MQTT Providers

Because MQTT brokers don’t really store messages long term (unlike email) moving providers should be relatively easy.

Related Articles and resources:

Please rate? And use Comments to let me know more
[Total: 29    Average: 3.4/5]


  1. hi sir
    I have make an program for DS18b20 sensor, it’s running when i operation by REPL to using “import main” command, but when i remove USB cable from my PC and plug in it into USB mobile charger (2amp charger) that time code stop at “Client.connect()” line and not connecting to my mqtt server

    what should i have to add in my code pls suggest me

    please help me regarding this

    code are bellow

    import onewire, ds18x20, time, network, machine
    from umqtt.simple import MQTTClient

    ds_pin = machine.Pin(15)
    led1= machine.Pin(2, machine.Pin.OUT)

    ds_sensor = ds18x20.DS18X20(onewire.OneWire(ds_pin))

    roms = ds_sensor.scan()

    print(‘Found DS devices: ‘, roms)

    SERVER = ‘’
    CLIENT_ID = ‘ESP32′

    TOPIC = b’temp’

    client = MQTTClient(CLIENT_ID, SERVER)



    while True:



    for rom in roms:



    t = ds_sensor.read_temp(rom)

    msg = (b'{0:3.1f}’.format(t))

    client.publish(TOPIC, msg)







    1. Hi
      Sorry but never used the DS18b20 sensor.I gather that it is arduino which I’m not a big user of and don’t know how to use it with Python.
      I have a feeling that it needs to be plugged into the PC as that is the way the python code is working but I don’t know for sure.

  2. Hello Steve,
    Could be a silly question but does MQTT support image payload? If yes any headsup which MQTT broker/client supports images? Any experience would you like to share with me


  3. Dear Steve,

    I have the broker, I want to connect to this server using MQTT command.


    AT+CMQTTCONNECT this command requires the TCP. I don’t what is the TCP server address.

  4. Using Eclipse Mosquitto, how can I run an application? I wanted to check the performance like the update time between publisher and subscriber. How do I do that?

Leave a Reply

Your email address will not be published. Required fields are marked *