Step by step installing and configuring Mosquitto with Windows 7

Mosquitto is a MQTT (MQ Telemetry Transport) broker used for handling lightweight data transfer protocol. This broker is based on open source which implements MQTT v 3.1 and v3.1.1 as I write this post. This Post would be useful for someone who would like to configure Mosquitto in Windows 7 and test it.

Step 1: Download mosquito from the Download section of In this example we will go through the use of the first link which would be native build applicable for Windows Vista and above.

Step 2: It will take you to the Eclipse repository with mirror options through which you can download the exe file.

Step 3: Double clicking the downloaded exe will throw you with the following screen through you might need to download the OpenSSL and pThreads.

Quick Links:



Step 4: Download the Win32 OpenSSL v1.0.2c Light setup file and install it. We need to get couple of DLL files from this installation which we will see it in the subsequent steps.

Pthreadvc2.dll will be found as given below which can right click and save it to the folder you need.

Step 5: The next step would be asking if you want to install the service too, select it and click next

Step 6: Select install location as given below

Step 7: Installation will get progressed once you press Install as given below

Step 8: Now the installation is done, we need to make sure the following files are copied to the folder where Mosquitto is installed.

Dependencies – win32

Required DLLs: libeay32.dll ssleay32.dll (Look for these files in the OpenSSL-Win32 or OpenSSL-Win32\Bin folder)

Required DLLs: pthreadVC2.dll

Important Note: Please ensure that the required DLLs are on the system path, or are in the same directory as the mosquitto executable.

Step 9: You need to reinstall Mosquitto so that it will also configure the windows Services as shown below as it has the necessary pre-requisites now in the folder C:\Program Files (x86)\mosquitto.

Step 10: How to check if Mosquitto broker has started and running? use the command netstat -an from the command prompt

In another post we will see how we can test the Mosquitto on MQTTLens using Chrome Extensions, mosquitto_pub and mosquitto_sub.

58 thoughts on “Step by step installing and configuring Mosquitto with Windows 7

  1. i have done every installation properly and ensured that the dll files are at mosquitto folder but still i m unable to see that particular line in cmd prompt (TCP 0:0:0:1883…)can anyone pls help me out?


  2. Hi,
    I followed the above steps but still I’m not able to see mqtt running as shown. Although when I run the executable file in my installation directory it shows a MSVCR120.dll missing. Even if I place the required DLL in the installation directory it fails to run. Can you please suggest any solution. Thank you


  3. I have done every installation step properly and ensured that the dll files are at Mosquitto folder but still I’m unable to see that particular line in cmd prompt (TCP 0:0:0:1883…). I’ve even tried restarting my laptop without any success. Can anyone pls help me out? How to check if the Mosquitto broker services are running?


  4. I am very new to Mosquitto so apologies if I am asking stupid question. I have installed mosquitto server on my local system. I am able to see Mosquitto server running but I need to run mosquitto.exe explicitly from the command prompt. I am also able to publish and subscribe the messages. Now my question is how can I connect this server to other clients like mobile or other clients like hardware (esp8266). Any help in this area would be highly appreciated.

    Liked by 1 person

  5. Hi,
    Thanks for the help above, although i was able to run the service successfully after some tweaking here’n’there. Just wanted to know, to introduce client authorization i set ‘allow_anonymous’ to false and provide path to ‘password_file’ in mosquitto.conf and start broker with this config file. But still the broker allows client connections without any username and pass


      1. Hello Friend.
        Thanks a lot for this tutorial!
        I made all the steps above and now I’m able to subscribe and publish messages with the MQTT lens, but I also want to connect to the broker with my mobile phone using some App from the Play market. This is never working for me and I receive error connection failed on the App.
        Do I need to configure something else to make everything working?
        Thanks in advance!


  6. Hi Friend. Thanks for the both tutorials!
    I made all the installations like described and now I’m able to subscribe and publish messages in the MQTTLens. Now I’m trying to connect to the broker from my mobile phone with special App for the MQTT and it never connects to the server.
    Do I need to configure anything else for that?
    Thanks in advance.


  7. Doesn’t work. I have all the required files in mosquitto directory. Reinstalled mosquitto, but it’s still not running as a service.


  8. Thank you sir. I have followed all the steps successfully. But only one problem. I have to download “Win32 OpenSSL v1.0.2j Light” instead of “Win32 OpenSSL v1.0.2c Light”. Will it create any problem in future?


  9. I am installing this on a win 7 pc. While the installs run fine I am unable to find the required files libeay32.dll ssleay32.dll. I also installed the OpenSSL hoping that it would provide the needed files but they are not there. I also get an error for cygcrypto-1.0.0.dll. I was able to find an install Pthreadvc2.dll .


    1. Thanks for your inputs. May be you’re right because when I tried I had visual studio in my Machine already available. Thanks for the sharing the links as well it would be useful for many.


  10. Hi,
    first of all great job !!!
    I tried to install Mosquitto on a win 7 pc, I followed all steps but the install doesn’t work.
    The error is:
    VCRUTIMEE140.dll isn’t present in the computer.
    Reinstalled mosquitto, but the error is still present.
    Can you help me ?


  11. hi, i got my mosquitto running. when i try to build my subscriber using golang (the publisher is from arduino), it has got an error. the program was initially made for fedora, so its got

    MQTT “”

    in the import part..

    but now, when i try to run it in windows, offcourse it will not recognize that…

    how do i get those packages ?

    best regards


  12. I installed the Moquitto on my Win 10. But after copying the three DLL to mosquitto folder I am getting an error “The application was unable to start…) Any help please.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s