The guide provided on the Unifi help page is very outdated. Here are the up-to-date steps to install the Unifi Network Application (8+) to Debian 12 (or Ubuntu 22.04, 22.10, 23.04).
# Update package lists, upgrade all packages, and remove unnecessary packages sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y # Install required packages sudo apt install -y gnupg curl ca-certificates apt-transport-https # Add MongoDB GPG key and repository curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | sudo gpg -o /usr/share/keyrings/mongodb-server-7.0.gpg --dearmor echo "deb [ arch=amd64 signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] http://repo.mongodb.org/apt/debian bookworm/mongodb-org/7.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list # Add Unifi GPG key and repository curl -fsSL https://dl.ui.com/unifi/unifi-repo.gpg | sudo gpg -o /usr/share/keyrings/unifi-repo.gpg --dearmor echo 'deb [ arch=amd64 signed-by=/usr/share/keyrings/unifi-repo.gpg ] https://www.ui.com/downloads/unifi/debian stable ubiquiti' | sudo tee /etc/apt/sources.list.d/unifi.list # Update package lists again to include the new repositories sudo apt update # Install MongoDB and Unifi sudo apt install -y mongodb-org sudo apt install -y unifi
If you are trying to update a previous install, you will need to create a backup of your current site (NOT export site), then install the new site as above (do not “restore” during install), then after you have created the new “blank” site, restore the backup.
EDIT: If you are installing this to an ARM device (raspberry pi, for example), you will want to change arch=amd64
to arch=arm64
.
EDIT 2: I separated out the steps to install mongo and unifi. Someone posted an error in the install process and I suspect it might have been caused by unifi trying to install before mongo was finished installing. Separating out the steps will ensure that mongo is installed before unifi tries to install.