Install Unifi Controller Raspbian OS Bullseye
Download a 32Bit version! for Unifi Controller
Based on: https://lazyadmin.nl/home-network/installing-unifi-controller-on-a-raspberry-pi-in-5-min/
Prepare SD Card
- Use a 32b image from: https://www.raspberrypi.com/software/operating-systems/
- Flash the image to the SD memory card using the Pi Imager : https://downloads.raspberrypi.org/imager/imager_latest.exe
- Click Choose OS
- Select Raspberry Pi OS (other)
- Choose Raspberry Pi OS Lite (32bit)
- Select Advanced options:
- set hostname
- enable SSH
- set username and password
Configure RaspberryPi at first boot
- boot Pi
- ssh to ip of Pi (192.168.1.10) and start config menu
Bash:
sudo raspi-config
- Select 3 (Interface Options) → I2 SSH → Enable SSH
- Select 5 (localisation Options) → L2 timezone → Europe → Amsterdam
- Select 6 (Advanced Options) → set predicatbles network names to -> NO
- Select 6 (Advanced Options) → A1 expand filesystem
- Select 4 (Performance Options) → P2 GPU → Change 64MB to 16MB
Disable IPv6
Bash:
# Disable IPv6 on all adapters
echo 'net.ipv6.conf.all.disable_ipv6 = 1' | sudo tee --append /etc/sysctl.conf
# reboot system
sudo reboot
Installation Unifi Controller
Prerequisite
RaspberryPi has to be installed.Prepare
Bash:
## Update the system (this may take some minutes)
sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get autoremove && sudo apt-get autoclean
## increase startup performance
sudo apt install rng-tools-debian
sudo nano /etc/default/rng-tools-debian
replace #HRNGDEVICE=/dev/hwrng --> HRNGDEVICE=/dev/hwrng
sudo systemctl restart rng-tools
Java 8
Java Runtime 8 (JRE)
Prerequisites is not included in Bullseye and need to be installed manually.
Bash:
## Remove old java (just to be sure)
sudo apt-get purge openjdk*
## install java 8
sudo apt-get update
sudo apt install openjdk-8-jre-headless -y
## Test
$ java -version
openjdk version "1.8.0_312"
OpenJDK Runtime Environment (build 1.8.0_312-8u312-b07-1+rpi1-b07)
OpenJDK Client VM (build 25.312-b07, mixed mode)
Set Default Java version
If multiple version of java have been installed, set a default.
Bash:
sudo update-alternatives --config java
Unifi Controller
Bash:
## latest version of MongoDB isn’t supported by the Unifi Controller.
## Avoid an error and set a different repository for MongoDB (to Rasparian Stretch)
## this will install mongodb 2.4
echo 'deb http://archive.raspbian.org/raspbian stretch main contrib non-free rpi' | sudo tee /etc/apt/sources.list.d/raspbian_stretch_for_mongodb.list
## Add the repository for the Unifi Controller:
echo 'deb http://www.ui.com/downloads/unifi/debian stable ubiquiti' | sudo tee /etc/apt/sources.list.d/100-ubnt-unifi.list
#echo 'deb [signed-by=/usr/share/keyrings/ubiquiti-archive-keyring.gpg] https://www.ui.com/downloads/unifi/debian stable ubiquiti' | sudo tee /etc/apt/sources.list.d/100-ubnt-unifi.list
## Authenticate the software:
sudo wget -O /etc/apt/trusted.gpg.d/unifi-repo.gpg https://dl.ubnt.com/unifi/unifi-repo.gpg
## Install the Unifi Controller software:
sudo apt-get update; sudo apt-get install unifi -y
## clean up use of wasted resources. Remove the default database that comes with the MongoDB instance
sudo systemctl stop mongodb & sudo systemctl disable mongodb
Unifi Services
Start / stopping unifi services
Bash:
systemctl stop unifi
systemctl stop mongodb
Upgrade Controller
Before upgrade, make sure you create a new backup.
Update and Install prerequisites
Bash:
sudo apt-get update && sudo apt-get upgrade -y
Upgrade itself
Bash:
sudo apt-get update --allow-releaseinfo-change && sudo apt-get upgrade -y