UniFi - Advanced: Changing Default Ports


This article describes how to change ports from their default assignments. Find the different default ports in our UniFi - Ports Used article.

Table of Contents

  1. Steps - How to Change Ports
  2. Example (Windows)
  3. Log Files Location
  4. Video Tutorial
  5. User Tips & Notes
  6. Related Articles

Steps - How to Change Ports

Back to Top

UniFi gives operators the freedom to change ports from their default assignments. By using a network utility (netstat, etc.), users can determine which ports are in use/opened/closed. The steps are outlined below:

  1. Close any instances of UniFi Network Controller software.
  2. Modify the file system.properties accordingly—the file can be found in the directory <unifi_base>/data/system.properties. See this article for more on <unifi_base>, and this article for information on the system.properties file.
  3. Make sure all ports needed by UniFi are available (see this article).
  4. Restart UniFi.
ATTENTION:Make sure there are no leading or trailing spaces, comments, or other characters like hash tags (#) on any custom lines as the Controller will ignore the customizations if there are.

Example (Windows)

Back to Top

  1. Run "netstat -ano" command in the command line.
  2. Locate the PID (process identifiers) for the mentioned port in use.
  3. Open task manager, select view and select columns, put a check for PID.
  4. Check the process corresponding to the PID located for the port during step 2.
  5. End the process if it is possible.
  6. If not possible go on the location <unifi_base>/data and open the system file with word or notepad.
  7. Modify this file to change the port that was in use.  For example, if port 8081 was in use you would modify the line unifi.shutdown.port=8081 to something like unifi.shutdown.port=8089 assuming port 8089 was not already in use.
NOTE:If the Controller software has never been run, the system.properties file won't exist yet. Run the UniFi Discovery Utility or the UniFi Network Controller software (if no port conflict exists) to generate it.
Windows or Mac will have an icon for the UniFi Discovery Utility but Linux will not. Users on Linux will have to load it via CLI with the following command:
java -jar /usr/lib/unifi/lib/ace.jar discover

Log Files Location

Back to Top

Log files will be essential for any troubleshooting performed. 

NOTE: If your controller is running on a Unix/Linux based system, then you will require superuser (sudo) privileges to access these log files. Unfamiliar with sudo? This external article might help.

Video Tutorial

Back to Top

NOTE:The following video is based on v2.x. However, the system.properties file still rests in the same directory <unifi_base>/data/system.properties in v3, v4 and v5.


User Tips & Notes

Back to Top

  • As mentioned in the warning above, if you customize any ports or system variables you need to make sure there are no comments (#), or extra characters leading or trailing on the line. If the variable you want to customize is in the commented section it is recommended that you copy just the variable, paste it below the commented section and customize as needed.
  • If you're modifying the system.properties file on a Unix/Linux system, please note that it will require super user (sudo) privileges to edit the file. There are no special requirements other than that, so you can use your preferred text editor (vi, emacs, nano, etc.).
  • Since UniFi Network Controller version 5.6.x the UniFi service does not run as root. This means that you cannot bind to privileged ports (<1024). The controller will fail to start if you try to use these ports.

Related Articles

Back to Top

UniFi - system.properties File Explanation

UniFi - Ports Used

UniFi - Where is <unifi_base>?

Was this article helpful?
33 out of 65 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