How to run UniFi Controller as a Windows Service

label_outlinechat_bubble_outline Comment

UniFi makes affordable access points that we often use in house and with our clientele.

One of the most common requests is to have the UniFi Controller start as a service. Most of the time this controller is installed on a server. It can be a bit daunting to remember that the controller needs to be manually started whenever the server is restarted. Setting the controller as an automated service will cause the controller to re-launch every time the server is started.

Here’s how we go about setting the UniFi controller as a service.

1. Make sure UniFi is not running

2. Locate your java installation directory. On 64-bit, it’s usually at “C:\Program Files (x86)\Java\jre7\bin”; otherwise “C:\Program Files\Java\jre7\bin”.

3. Add the complete directory path that we located in step 2 to the PATH variable by accessing the system variables – Computer(right click)->Properties->Advanced system settings->Environment Variables. Be sure to add this at the end of the list and to precede the path with a semi-colon “;” to separate the previous path with this path.

4. run a command prompt as an Administrator, right click on ‘Command Prompt’ and choose ‘Run as administrator’

5. cd “%userprofile%/Ubiquiti Unifi” – (including the quote marks)

6. java -jar lib\ace.jar installsvc

7. Start the service: net start “Unifi Controller”

That’s it! You have now created a service that will start the UniFi controller each time the server, or computer, is started.

If in the future java is updated to a new release you will have to modify the PATH settings again and you may also have to re-install the service. In order to re-install the service it would be a good idea to remove the old service first. Below you’ll find instructions on removing the UniFi service should you want to re-install it for a new release or remove the controller completely.

1. Hit the windows key and type regedit and press enter.

2. Find and delete the registry key “HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/UniFi”

Alternately you can delete the service by the using the command prompt:

1. sc delete UniFi

From all of us at WireFlare we ask that you help others find the answers they are looking for. Please leave a comment or share this post!

About

Blog Bio Picture For Todd

I'm the President of WireFlare. I have a passion for creativity, online business and internet security. I strive to create a community that empowers people to be themselves. I'm an adventurist, fun loving and caring. Find me hiking in places most people don't dare to go!

Get a free consultation today!