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
- Steps - How to Change Ports
- Example (Windows)
- Finding Your Log Files
- Video Tutorial
- User Tips & Notes
- Related Articles
Steps - How to Change Ports
UniFi gives operators the freedom to change these 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:
- Close any instances of UniFi software (Controller).
- Modify the file
system.propertiesaccordingly—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
- Make sure all ports needed by UniFi are available (see this article).
- Restart UniFi.
ATTENTION: Make sure there are no leading or trailing spaces, comments, or other characters on any custom lines as the Controller will ignore your customizations if there are.
"netstat - ano"command in the command line.
- Locate the PID (process identifiers) for the mentioned port in use.
- Open task manager, select view and select columns, put a check for PID.
- Check the process corresponding to the PID located for the port during step 2.
- End the process if it is possible.
- If not possible go on the location <unifi_base>/data and open the system file with word or notepad.
- 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=8081to something like
unifi.shutdown.port=8089assuming port 8089 was not already in use.
NOTE: If the Controller software has never been run, the system.properties file won't exist yet. You can run the UniFi Discovery Utility or the UniFi 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:
Log Files Location
Log files will be essential for any troubleshooting you might perform. Find them here:
NOTE: If your controller is running on a Unix/Linux based system, then you will require superuser (
User Tips & Notes
- 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.propertiesfile 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 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.