×

UniFi - Run the Controller as a Windows Service

Overview

This article describes how to set up the UniFi Network Controller to run as a Windows service, and how to update it when it's running this way. It applies to Windows 8 and 10, but does not apply to Window Server versions.

USER TIPS:
  • Switching to a service means some ports must be open on the Windows firewall. See what ports must be open in this article: UniFi - Ports Used. To learn how to  change ports, see UniFi - Changing Default Ports for Controller and UAPs.
  • 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. Current releases should work with just x64 Java on Windows x64. However, there may be some exceptions due to other system issues/conflict or misconfiguration. If facing issues, test installing both x64 and x86.

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 Network Controller application if it is being run as a Windows service.

How to Set Up the UniFi Network Controller as a Windows Service

Back to Top

1. Close any instances of the UniFi software on the computer. If the UniFi Network Controller was just installed, 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, the controller may be closed.

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 the 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 Network 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 Network Controller now open a browser and go to https://localhost:8443. Alternatively, the desired interface IP, or FQDN that is mapped to that host (in place of “localhost”) may be used.

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

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

Back to Top

1. Open the UniFi Network Controller 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 the 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 Network 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 Network 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 Network Controller installation package for Windows from the Downloads page or the Releases section of the Community.

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

7. In the Command Prompt issue the following to install the UniFi Network 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 Network Controller now open a browser and go to https://localhost:8443. Alternatively, the desired interface IP, or FQDN that is mapped to that host (in place of “localhost”) may be used.

Related Articles

Back to Top

UniFi - Ports Used

UniFi - Change Default Ports for Controller and UAPs

Was this article helpful?
62 out of 102 found this helpful
Can't find what you're looking for?
Visit our worldwide community of Ubiquiti experts for more answers
Visit the Ubiquiti Community