HiveMQ on Windows Azure – MQTT in the Microsoft Cloud

Infrastructure as a Service (IaaS) providers like Microsoft Windows Azure and Amazon Webservices (AWS) are excellent choices for building reliable and scalable infrastructures for your service or platform and are a very good alternative to hosting your own hardware boxes in a computing center on your own. In this post you will learn how to get the HiveMQ MQTT broker up and running in minutes on the Microsoft Windows Azure Cloud – of course with Websockets enabled!

Installation

This will explain how to install HiveMQ on an Azure Linux VM. The steps may vary when using Windows as operating system. If you want use the native Websockets implementation of HiveMQ to enable MQTT over Websockets, please make sure you follow all steps which are marked as optional.

As a prerequisite, you need a valid Windows Azure Account. If you haven’t created one yet, start with that here.

  1. Create a new Virtual Machine via the Azure Web Interface. Select the newest Ubuntu LTS as Image.
  2. After the Virtual Machine was created, we have to open the standard MQTT port which happens to be 1883. Go to the Endpoint Settings of your VM in the Azure Web Interface and add a new Endpoint. Use TCP as protocol and set the public and private port to 1883.
  3. optional: Create another endpoint for Websockets. Use TCP as protocol and set both ports to 8000.
  4. Now connect to your server instance via SSH.
  5. Execute the following command to install all required dependencies: This could take a few minutes to install.
  6. Download the latest HiveMQ version with the following command:
    (Replace YOUR-HIVEMQ-DOWNLOAD-LINK with your personal download link which you get from the HiveMQ Download page)

  7. Unzip HiveMQ:

  8. Start HiveMQ:

And now we have a HiveMQ MQTT server up and running in the Microsoft Windows Azure Cloud with Websockets support. You can try any MQTT tool you like to test the broker. Or you could just use the Websockets MQTT client. Just make sure you use the correct port, which is 1883 for MQTT and 8000 for Websockets.

Conclusion

We have seen it’s very easy to get a HiveMQ instance up and running in the Azure Cloud. Since HiveMQ is extremely portable, it runs on Linux and Windows Azure Virtual Machines. Of course you can gain a new dimension of scalability if using Azures load balancing with HiveMQs built-in cluster functionality.

Do you use or plan to use an IaaS provider? Have you tried Azure for your services, yet? Let us know in the comments!

8 comments

  1. Milan chhatralia says:

    How do we can create the topic after creating establishing the broker?

    1. Hi there,

      Topics in MQTT are dynamically created, when a client subscribes or publishes on them.

      Best regards,
      Florian from The HiveMQ Team.

  2. Would a newer Ubuntu image work too? I see 17.10 ATM as the featured one..

    1. Hi Daniel,

      Nice to see you’re taking an interest in MQTT and HiveMQ.

      HiveMQ support does support every available Linux distribution. That includes also Ubuntu in its newest version.

      Kind regards,
      Abdullah from the HiveMQ Team.

  3. This command no longer works, since it points to a webpage instead of a zip: wget --content-disposition https://www.hivemq.com/downloads/releases/latest

    1. Hi Daniel,

      thank you for pointing that out, we have corrected the article.

      Kind regards,
      Abdullah from the HiveMQ Team.

  4. Abhishek Dixit says:

    Thanks for the wonderful MQTT support.

    I was able to install and run HIVEMQ on Ubuntu VM hosted on Azure.

    Need a small clarification about how to make HiveMQ run on boot ? Any help would be highly appreciated.

    1. Hi Abishek,

      Nice to see you’re taking an interest in MQTT and HiveMQ.

      You can find a guide in our documentation to install hivemq as a service und make it start on boot.

      If you need further assistance, feel free contact us again.

      Kind regards,
      Abdullah from the HiveMQ Team.

Leave a Reply

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