This article provides the steps to update the UniFi Controller on a Debian or Ubuntu system via APT (Advanced Package Tool). You will need to create source files, or edit lines in an existing sources.list file with vi or nano. That is the most common method for package updates and installs for these OS. The repo structure should be permanent, but if there are any changes they will be pointed out in the release posts.
NOTES & REQUIREMENTS:
Before upgrading the UniFi Controller, make sure that you have backed up the UniFi Controller 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 link.
Table of Contents
UniFi Controller APT Steps
Follow these instructions to stay with the current stable release, regardless of changes in versions. When there is a new stable release, typically there will be a post on the Community announcing it.
Use the following command to add a new source list:
echo 'deb http://www.ubnt.com/downloads/unifi/debian stable ubiquiti' | sudo tee /etc/apt/sources.list.d/100-ubnt-unifi.list
Using http://www.ubnt.com/downloads/unifi/debian on a browser will result in a 403 Forbidden page. This is because we do not allow direct listing/access to this link. The URL is only meant to be used when using the CLI commands as in the one shown above.
2. Add the GPG Keys. To add the GPG Keys use one of the two methods described below, Method A is recommended. When using the commands below, it is assumed you have
wget installed, more information about
sudo can be found here, and
(Method A) Download and install the following trusted key into
sudo wget -O /etc/apt/trusted.gpg.d/unifi-repo.gpg https://dl.ubnt.com/unifi/unifi-repo.gpg
(Method B) Using apt-key
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 06E85760C0A52C50
3. Update. Retrieve the latest package information. Note: If this results in an error, please check the User Tip below.
sudo apt-get update
4. Install and upgrade the UniFi controller.
sudo apt-get install unifi
Your UniFi Controller should now be accessible at the computer's configured local or public IP address.
5. (Optional) 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.
We strongly recommend staying with the stable release, but for those users who wish to do otherwise, find the possible suite names, as well as code names in the table below.
"Testing" refers to the next generation release, it's not released to the general public yet. "Stable" refers to the current stable release, that is the one supported by UBNT and described in this article. "Old Stable" is the previous stable release, once it has been displaced by the new, current stable release.
*unifi-5.7 is empty at the moment
Log Files Location
Log files will be essential for any troubleshooting you might perform. Find them here:
User Notes & Tips
These notes have been added thanks to user collaboration. Have anything to contribute? Click on the Give Feedback button below!
The following affects APT versions 1.5 onward (Ubuntu 17.10 and Debian Sid or newer). A recent version of the apt-secure man page stated: "Since version 1.5 changes in the information contained in the Release file about the repository need to be confirmed before APT continues to apply updates from this repository", meaning that when performing an update from a major version to the next (for example 5.5.x to 5.6.x) the
apt-get updatewill result in an error. To fix this run the command the following way:
apt-get update --allow-releaseinfo-change
- The UniFi Controller when installed on Debian and Ubuntu will not have a GUI since it's being run as a Service. Please use the service command for starting, stopping and restarting the UniFi Controller.
- If you see the following error on your DNS server, a user reports solving this by forcing the system to use 188.8.131.52 as DNS server, not his ISP.
- If it's taking too long to access the controller after a restart, and you need to generate enough entropy on a headless VM to start up SSL, this Community post might help: Ubuntu 14.04 x64 Unifi 4.6.6 very slow start up.
- At the moment Ubiquiti does not support arm64, hence it is not available via the repo. A download and manual installation will be necessary for this.