Skip to content

Instantly share code, notes, and snippets.

@asheroto
Last active March 17, 2026 22:11
Show Gist options
  • Select an option

  • Save asheroto/b50ad335b268b58e1083aabdd849b537 to your computer and use it in GitHub Desktop.

Select an option

Save asheroto/b50ad335b268b58e1083aabdd849b537 to your computer and use it in GitHub Desktop.
Running Ubiquiti UniFi Controller as a Windows Service or on Startup (simply)

Running the UniFi Network Controller as a Windows Service or on Startup

The controller will run fine using the built-in java.exe included with the UniFi software, so no additional installation is required for basic functionality. However, Ubiquiti recommends using Adoptium due to Oracle Java licensing concerns and to stay current with supported versions.

If you choose to follow that recommendation instead of using the bundled Java, refer to the official guide to determine the correct Java version for your UniFi release. If using Adoptium, update the path to java.exe to match your installed version (the jdk-17.x.x folder name will differ on your system).

The examples below show both approaches. The only difference is which java.exe you call.


Method 1: Using a Traditional Windows Service

  1. Open PowerShell as Administrator.

  2. Navigate to the UniFi installation folder:

    Set-Location "$ENV:USERPROFILE\Ubiquiti UniFi"
  3. Install the UniFi Network Controller as a service:

    Built-in Java:

    .\jre\bin\java.exe -jar lib\ace.jar installsvc

    Adoptium Java:

    & "C:\Program Files\Eclipse Adoptium\jdk-17*\bin\java.exe" -jar "$ENV:USERPROFILE\Ubiquiti UniFi\lib\ace.jar" installsvc
  4. Start the service:

    Built-in Java:

    .\jre\bin\java.exe -jar lib\ace.jar startsvc

    Adoptium Java:

    & "C:\Program Files\Eclipse Adoptium\jdk-17*\bin\java.exe" -jar "$ENV:USERPROFILE\Ubiquiti UniFi\lib\ace.jar" startsvc
  5. Removing the service (if needed):

    Built-in Java:

    .\jre\bin\java.exe -jar lib\ace.jar uninstallsvc

    Adoptium Java:

    & "C:\Program Files\Eclipse Adoptium\jdk-17*\bin\java.exe" -jar "$ENV:USERPROFILE\Ubiquiti UniFi\lib\ace.jar" uninstallsvc
  6. Test:

    https://127.0.0.1:8443
    

Method 2: Using Task Scheduler

  1. Open Task Scheduler (taskschd.msc).

  2. Go to Task Scheduler Library.

  3. Click Create Task.

  4. Configure:

    General Tab

    • Name: UniFi Network Controller
    • Run whether user is logged on or not

    Triggers Tab

    • At startup
    • Enabled

    Actions Tab

    Built-in Java:

    "%UserProfile%\Ubiquiti UniFi\jre\bin\java.exe"
    -jar "%UserProfile%\Ubiquiti UniFi\lib\ace.jar" ui

    Adoptium Java:

    "C:\Program Files\Eclipse Adoptium\jdk-17*\bin\java.exe"
    -jar "%UserProfile%\Ubiquiti UniFi\lib\ace.jar" ui
  5. Test

    https://127.0.0.1:8443
    

Both methods work with either the bundled Java or Adoptium. The only difference is the path to java.exe. Tested on Windows 11 and Server 2025.

@InsanityOnABun
Copy link
Copy Markdown

They recommend using Adoptium because Oracle's licensing for Oracle Java is so insanely hostile at this point. I don't know what version of Java that ships with the network controller by default, but its either horrifically out of date - like over 7 years old at this point - or use of it is against Oracle's terms of use.

@asheroto
Copy link
Copy Markdown
Author

@InsanityOnABun that makes a lot of sense! I forgot about Oracle Java going hostile with licensing. I just updated the gist, does it read like it should?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment