The trick to all methods is to use the java.exe
built into the UniFi software, NOT the Adoptium version recommended by Ubiquiti. They are confused. You don't need to install a separate software. You don't need to mess with the JAVA_HOME
variable. As long as you specific the commands exactly as shown below, it should work. Tested and confirmed working on a new Windows 11 computer.
-
Open PowerShell as Administrator.
-
Navigate to the UniFi installation folder:
Set-Location "$ENV:USERPROFILE\Ubiquiti UniFi"
-
Install the UniFi Network Controller as a service:
.\jre\bin\java.exe -jar lib\ace.jar installsvc
-
Start the service:
.\jre\bin\java.exe -jar lib\ace.jar startsvc
-
Removing the Service (if needed):
- If the service malfunctions or needs to be reinstalled, uninstall it using:
.\jre\bin\java.exe -jar lib\ace.jar uninstallsvc
- If the service malfunctions or needs to be reinstalled, uninstall it using:
-
Open Task Scheduler:
- Option 1: Press
Win + R
, typetaskschd.msc
, and press Enter. - Option 2: Open the Start menu, type
Task Scheduler
, and select it from the search results.
- Option 1: Press
-
Navigate to Task Scheduler Library:
- In the left-hand panel, go to Task Scheduler (Local) > Task Scheduler Library.
-
Create a New Task:
- Click on Create Task… in the right-hand panel, or right-click in the middle panel and select Create New Task….
-
Configure the New Task:
- General Tab:
- Name:
UniFi Network Controller
- Security options: Select Run whether user is logged on or not.
- Name:
- Triggers Tab:
- Begin the task: At startup.
- Advanced settings: Enable the checkbox for Enabled.
- Actions Tab:
- Action: Start a program.
- Program/script: Browse and set the path to
- General Tab:
"%UserProfile%\Ubiquiti UniFi\jre\bin\java.exe"
- Add arguments:
-jar "%UserProfile%\Ubiquiti UniFi\lib\ace.jar" ui
- Settings Tab:
- Enable:
- Allow task to be run on demand.
- Run task as soon as possible after a scheduled start is missed.
- Uncheck all other options.
- Enable:
- Test the Task:
- Restart your system.
- Once running, wait a few seconds and make sure you can access the UniFi interface:
https://127.0.0.1:8443
By following either of these methods, you can run the UniFi Network Controller as a persistent service on your Windows system.