unifi controller install: debian 11
#https://lawrencesystems.com/self-hosted-unifi-network-application-controller-install-tutorial/
#mongodb 3.4 would not install because of libssl issue, 3.6 will on debian 11 as of 5/26/2023
# Based on UI documentation https://help.ui.com/hc/en-us/articles/220066768-UniFi-How-to-Install-and-Update-via-APT-on-Debian-or-Ubuntu
# Install base needs and java 11
apt-get update && apt-get install ca-certificates apt-transport-https openjdk-11-jre-headless gnupg2 -y
# Add Ubiquiti & Mongo to the sources
echo ‘deb https://www.ui.com/downloads/unifi/debian stable ubiquiti’ | tee /etc/apt/sources.list.d/100-ubnt-unifi.list
#echo “deb https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse” | tee /etc/apt/sources.list.d/mongodb-org-3.4.list
echo “deb http://repo.mongodb.org/apt/debian stretch/mongodb-org/3.6 main” | tee /etc/apt/sources.list.d/mongodb-org-3.6.list
# Add trust for Ubiquiti and Mongo sources
#wget -qO – https://www.mongodb.org/static/pgp/server-3.4.asc | apt-key add –
wget -qO – https://www.mongodb.org/static/pgp/server-3.6.asc | apt-key add –
wget -O /etc/apt/trusted.gpg.d/unifi-repo.gpg https://dl.ui.com/unifi/unifi-repo.gpg
# Hold the java version for compatability so it does not break with updates
apt-mark hold openjdk-11-*
# Install the UniFi controller
apt-get update && apt-get install unifi -y
systemctl enable mongod
systemctl enable unifi