Running HiveMQ as a service on Windows OS

To run HiveMQ as a Windows service, we provided an alternative Windows service installation by using the NSSM tool.

Instructions for installing Windows service

  1. First, download a PowerShell script that will automate all required steps in the GitHub repository below.

Download "InstallHiveMQService.ps1" PowerShell Script

  1. Open Windows PowerShell as administrator.

  1. Temporarily sets the current PowerShell session execution policy to Bypass.

Set-ExecutionPolicy Bypass -Scope Process -Force
  1. Navigate to the folder where you downloaded the PowerShell script and execute the InstallHiveMQService.ps1 script to install the HiveMQ service and observe the execution output in the terminal.

.\InstallHiveMQService.ps1

We recommend installing HiveMQ in the C:\hivemq directory. The following steps assume this directory is used. If you have extracted HiveMQ to a different directory on your Windows OS, you can specify the parameter -installationFolder directly in the command line to specify a different version of HiveMQ or a different installation folder, sample command below.

.\InstallHiveMQService.ps1 -installationFolder "C:\hivemq"

If the HiveMQ Windows service is installed successfully, you will see the output like the screenshot below.

  1. At this point, you may confirm that HiveMQ is up and running. First, double-check if the service is installed and with the status “running”.

  1. The next step is to verify if you can access the HiveMQ administrative console in your browser at http://localhost:8080. The default username is admin and the default password is hivemq.

  1. Restart your machine. Upon reboot, verify that HiveMQ starts automatically.

 


Instructions for uninstalling Windows service

To remove the HiveMQ service, simply execute the following commands in either a Command Prompt or a PowerShell window.