Updating Self-Hosted UniFi Network Servers (Linux)
This article provides the steps to update the UniFi Network application to the current stable release on a Debian or Ubuntu system via APT (Advanced Package Tool). If you run into issues following the process described in this article, please take a look at the scripts provided in this Community post that includes UniFi Network software installation on Ubuntu 18.04 and 16.04 and Debian 8/9.
Requirements
In order to update the UniFi Network application via APT, it is necessary to create source files or edit lines in an existing sources.list file with Linux text editors: vi or nano. The repo structure should be permanent, but if there are any changes they will be pointed out in the UniFi Network software version release posts, found in the Release section of the Community.
Before upgrading the UniFi Network application, make sure that you have backed up the UniFi Network Database. You will need to make sure that the user has sudo permissions. For more information about adding a user to sudo list, see this Debian article.
UniFi Network APT Steps
- Install required packages before you begin with the following command:
sudo apt-get update && sudo apt-get install ca-certificates apt-transport-https
- Use the following command to add a new source list:
echo 'deb https://www.ui.com/downloads/unifi/debian stable ubiquiti' | sudo tee /etc/apt/sources.list.d/100-ubnt-unifi.list
- Add the GPG Keys.
-
Method A - Recommended
- Install the following trusted key into
/etc/apt/trusted.gpg.d
sudo wget -O /etc/apt/trusted.gpg.d/unifi-repo.gpg https://dl.ui.com/unifi/unifi-repo.gpg
- Install the following trusted key into
- Method B
- Using apt-key:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 06E85760C0A52C50
- Using apt-key:
- When using the commands above, it is assumed you have
sudo
andwget
installed. More information aboutsudo
can be found here, andwget
here. - For Ubuntu 18.04, run the following commands before installing UniFi in step 4.
wget -qO - https://www.mongodb.org/static/pgp/server-3.4.asc | sudo apt-key add -
echo "deb https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list
sudo apt-get update - See an example of what scripts the Community is using to install the UniFi Network application on Ubuntu 16.04 and 18.04 in this Community post.
-
Method A - Recommended
- Install and upgrade the UniFi Network application.
- On some Distributions, it's possible an incompatible Java release can be installed during this step. We recommend running the following command before proceeding with this step, to restrict Ubuntu from automatically installing Java 11. If you wish to undo this later, replace "hold" with "unhold".
sudo apt-mark hold openjdk-11-*
- Install and upgrade the UniFi Network application with the following command:
sudo apt-get update && sudo apt-get install unifi -y
- On some Distributions, it's possible an incompatible Java release can be installed during this step. We recommend running the following command before proceeding with this step, to restrict Ubuntu from automatically installing Java 11. If you wish to undo this later, replace "hold" with "unhold".
- This step may not be required, depending on the Linux distro you have. If your distro does not come with MongoDB, and it's not available in their repo, then please see the MongoDB installation guide. You can find the latest installation guide for Ubuntu here, and Debian here. We recommend at least MongoDB 2.6.10. Some users have changed the backend to use MongoDB 3 successfully too.
- The UniFi Network application should now be accessible at the computer's configured local or public IP address, by typing that IP address in a browser's navigation bar (Chrome is recommended). If it is not launching, use the following command:
sudo service unifi start
Other Helpful Commands
- To stop the UniFi service:
sudo service unifi stop
- To restart the UniFi service:
sudo service unifi restart
- To see the status of UniFi service:
sudo service unifi status
Log Files Location
Log files are essential for any troubleshooting. Find them here:
- /usr/lib/unifi/logs/server.log
- /usr/lib/unifi/logs/mongod.log
If your application is running on a Unix/Linux based system, then you will require superuser (sudo) privileges to access these log files.