UniFi - Run the Controller as a Windows Service


Overview


This article describes how to set up the UniFi Controller to run as a Windows service, and how to update it when it's running this way.

USER TIPS: 
  • Switching to a service means you have to open up ports on your Windows firewall. The ports the UniFi Controller uses are listed in our UniFi - Ports Used article. If you would like to learn how to change ports, see our UniFi - Changing Default Ports for Controller and UAPs article.
  • Older versions of the UniFi Controller software may require both x64 and x86 Java to be installed on a Windows x64 system for it to run as a service properly. Recent UniFi 5.8 and 5.9 releases should work with just x64 Java on Windows x64. However, there may be some exceptions due to other system issues/conflict or misconfiguration. Help us verify if installing both x64 and x86 Java was your solution by sending us an email with the Send Feedback button at the bottom of this article.

Table of Contents


  1. Introduction
  2. How to Set Up the UniFi Controller as a Windows Service
  3. How to Upgrade a UniFi Controller that is Running as a Windows Service
  4. Related Articles

Introduction


Back to Top

Windows services are often useful since they are background applications which don’t require any attention from the end-user. The service launches upon startup, without any intervention from the user. The service is a direct replacement for running the controller software manually (via the icon or a scheduled task), so there is no need to run the UniFi Controller application if you're running it as a Windows service.


How to Set Up the UniFi Controller as a Windows Service


Back to Top

1. Close any instances of the UniFi software on your computer. If you just installed the UniFi Controller, make sure to open the controller software manually at least once, or let it run at the end of the wizard. Once you see the message UniFi Controller (a.b.c) started, you can close the controller.

2. Launch the Command Prompt as an Administrator. On Windows 10 this would entail right-clicking and selecting "Run as administrator". Please see Windows documentation to identify the appropriate method for your specific Windows version.

3. Change directory to the location of UniFi in your computer using the following command (exactly as it is here, no need to substitute anything):

cd "%UserProfile%\Ubiquiti UniFi\"

4. Once in the root of the UniFi folder, issue the following command to install the UniFi Controller service:

java -jar lib\ace.jar installsvc

5. Once you're at a new command prompt line, after it says “Complete Installation…”, issue the following:

java -jar lib\ace.jar startsvc

6. Close the command prompt window either by entering the exit command, or clicking the X.

7. To access the UniFi Controller you now need to open your browser and go to https://localhost:8443. Alternatively you can use the desired interface IP, or FQDN that is mapped to that host (in place of “localhost”).

NOTE: We recommend using Oracle Java JRE 8, which can be downloaded in Oracle's website. For the UniFi Cloud Access portal (unifi.ubnt.com) to work properly, you need to use x64 Java only.

How to Upgrade a UniFi Controller that is Running as a Windows Service


Back to Top

1. Open the UniFi Controller user interface and make a backup.

2. Launch the Command Prompt as an Administrator. On Windows 10 this would entail right-clicking and selecting "Run as administrator". Please see Windows documentation to identify the appropriate method for your specific Windows version.

3. Change directory to the location of UniFi in your computer using the following command (exactly as it is here, no need to substitute anything):

cd "%UserProfile%\Ubiquiti UniFi\"

4. Once in the root of the UniFi folder, issue the following to uninstall the UniFi Controller service:

java -jar lib\ace.jar uninstallsvc

5. Once a new command prompt line is presented, that means uninstalling the service was successful. Update the UniFi Controller application's version with any of the regular methods. Go to Settings > Maintenance in the Controller to upgrade to the latest public released version, or alternatively download the UniFi Controller installation package for Windows from the Downloads page or the UniFi Updates Blog.

6. Once the software update is successful, close the UniFi Controller application before going back to the Command Prompt.

7. In the Command Prompt issue the following to install the UniFi Controller service once again:

java -jar lib\ace.jar installsvc

8. Once you're at a new command prompt line, after seeing the "Complete Installation…" message, issue the following:

java -jar lib\ace.jar startsvc

9. Close the Command Prompt window either by entering the exit command, or clicking the X.

10. To access the UniFi Controller you now need to open your browser and go to https://localhost:8443. Alternatively you can use the desired interface IP, or FQDN that is mapped to that host (in place of "localhost").


Related Articles


Back to Top

UniFi - Change Default Ports for Controller and UAPs


We're sorry to hear that!