Keep EMQX Broker Windows Service running 24/7

How to Keep your EMQX Windows Service Running 24/7 with Service Protector

Automatically restart EMQX Broker whenever it stops, crashes or fails. Ensure that your MQTT broker is always running


Last Updated on October 16, 2026

EMQX is a massively scalable, highly extensible distributed MQTT message broker for IoT and mobile applications.

The MQTT broker can be installed as a service, to ensure that it starts interacting with clients as soon as your machine boots:


To monitor & bulletproof the EMQX Windows Service with Service Protector:

  1. Download and install Service Protector, if necessary.

  2. Start Service Protector.

  3. Select Protector > Add to open the Add Protector window:

    Add Protector

  4. On the General tab, in the Service to protect field, select the EMQX Broker windows service.

    Since we installed EMQX version 4.29, the service is called emqx_4.2.9 on our system:

    EMQX Broker Windows Service: General Tab

  5. Move to the Monitor tab. To keep your MQTT broker "fresh" and free of memory leaks and other unwanted accumulations, we recommend establishing a nightly restart of the service.

    To set that up, check the At the following times box, click the Add button and specify when you want the service to be recycled.

    For example, we have opted for a daily restart at 2 AM:

    EMQX Broker Windows Service: Monitor Tab

    Please feel free to select a weekly restart (during an established maintenance window?) if you think a daily schedule is overkill. Also, consider rebooting the entire operating system if you think that will improve the stability of your environment.

  6. We're done setting up EMQX Broker so click the Save button to record your settings. In a few seconds, a new entry will show up in the Service Protector window.

    The green shield indicates that Service Protector is already monitoring the EMQX Windows Service, to rapidly detect and react to crashes and other failures:

    EMQX Broker Windows Service: Protected

  7. That's it! Next time your computer boots, EMQX Broker will start automatically and Service Protector will babysit the service to promptly restart it if it stops for any reason.

    We encourage you to edit the EMQX entry in Service Protector and browse through the many other settings that may be appropriate for your environment.

    For example, send an email whenever the service fails, clamp down on RAM or CPU hogging, verify that TCP/IP connections are accepted, and much more.


Trouble protecting the EMQX Windows Service?

  • From Service Protector, select Protector > Report Activity > Today to bring up an HTML report detailing the interaction between Service Protector and EMQX.

  • Browse the Service Protector FAQ for answers to commonly asked questions and troubleshooting tips.

  • Contact us and we will be happy to help!