UniFi: Run the Controller as a Windows service

Here is a useful guide from Ubiquiti with regards to running the Controller service as a Windows Service. This is essential when running a centralized controller for your APs and to make sure you contoller would run automatically after a restart rather than enabling it to run maunally.

 

Originally posted at: https://help.ubnt.com/hc/en-us/articles/205144550-UniFi-Run-the-Controller-as-a-Windows-service


Readers will learn how to run the UniFi controller software as a Windows service.

Windows services are often useful since they are “background” applications which don’t require any attention from the end-user. In this way, the service will launch upon startup, without any intervention from the user. The service is a direct replacement/substitute for running the controller program manually (via the icon or a scheduled task), so there is no need to run the controller application if you’re running it as a Windows service.

Table of Contents


  1. Steps – How to Run the Controller as a Windows Service
  2. User Notes & Tips
  3. Related Articles

Steps – How to Run the Controller as a Windows Service


Back to Top

1. Close any instances of the UniFi software on the computer. If you just installed the UniFi controller, make sure to open it once by using the icon on the desktop or within the start menu. Once it says “UniFi Controller (a.b.c) started.” you can close the controller program. This is needed to generate some required files for the service to work.
2. Open the command prompt as an Administrator. For example, on Windows 10, right click on the Start Menu and choose “Command Prompt (Admin)”.
3. Change directory to the location of UniFi in your computer using the following command (exactly as it is here, no substituting needed):
cd "%UserProfile%\Ubiquiti UniFi\"
4. Once in the root of the UniFi folder, issue the following (this installs 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. There is no longer a controller applet, like that other window that popped up. To access the controller you 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: You will need to use Oracle Java JRE 8, which you can download HERE. For the UniFi cloud service (unifi.ubnt.com) to work, you need to use x64 Java only (so choose Windows x64 Offline). You can use either x86 or x64 Java for UniFi, but if you use x86 you cannot use the unifi.ubnt.com cloud tie in.When upgrading the service, first perform step 2 and 3, then run “java -jar lib\ace.jar stopsvc” (without quotes) to stop the old the service. After the update is complete, run “java -jar lib\ace.jar startsvc” (without quotes) to start the service for the updated controller instance.

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: