I'm using debian 10 as my daily so these are *nix commands. Mac should work with these too but you're on your own if you're using Windows. Goal for me is to make a headless raspberry pi I can SSH into and connect to my network using Ethernet. You should be comfortable in command line if you choose to follow this guide.
- Go to https://www.raspberrypi.org/downloads/raspbian and download Raspbian lite archive
unzip
the image- Plug in sdcard. Run
lsblk
to see drives and mount points. Likely, the sdcard will show up in/dev/sda
or /dev/sdb and may have some partitions like/dev/sda1
and/dev/sda2
. - If partitions are mounted, unmount all of them. Ex:
umount /dev/sda1
andumount /dev/sda2
- Copy the raspbian image to the sdcard with
sudo dd if=RASPBIAN_IMAGE_FILE.img of=/dev/sda bs=4M
- Run
sync
to ensure the written contents are flushed - OPTIONAL: To start ssh server on boot, Unplug sdcard and reinsert to remount new partitions. You'll have two with raspbian. Add ssh empty file with
touch /media/NAME_OF_DRIVE/boot/ssh
. Runsync
again to flush and then unmount. - Stick the sdcard into your raspberry pi and turn it on. It should start and the SSH server should start with it if you did step 7.
- Find Pi's assigned local IP from your router and finally ssh in with
ssh pi@LOCAL_ADDRESS
. Password is "raspberry"
The following is to be run on the Pi itself after SSHing in.
First we need java 8 because Unifi is so out of date. After hours of trying to figure out how to get it because Java 8 has been discontinued and no longer publically accessible, I did finally discover a way to get it.
sudo apt-get update
sudo apt-get install openjdk-8-jre-headless
Verify java 8 installed with java -version
Now to actually install unifi controller. There are two unifi official guides on this. One is to use apt repository which won't work because Unifi doesn't support armhf, and the other is to install the package yourself. We need to do the latter to make it work. You can find those instructions at the following link, however STOP BEFORE STEP 8 and follow my directions instead as it's slightly different: https://help.ubnt.com/hc/en-us/articles/360012282453-UniFi-How-to-Install-Upgrade-the-UniFi-Network-Controller-Software
Instead of step 8, do sudo apt-get install ./unifi_sysvinit_all.deb
as this will install all dependencies like the correct mongodb packages and others. It should succeed without errors and the controller should be accessible from https://PI_LOCAL_HOST:8443
UNMS won't work without us setting up docker. To do this, we'll be setting up oznu/docker-unms image. However, their wiki page doesn't work for Debian buster, only stretch. Do NOT follow the directions on https://github.com/oznu/docker-unms/wiki/UNMS-on-Raspberry-Pi as the first few steps won't work. Docker recommends to use convenience scripts to install itself on Raspbian, including Raspbian buster. Follow https://docs.docker.com/install/linux/docker-ce/debian/#install-using-the-convenience-script .
Don't forget to add the docker group to the pi user by running sudo usermod -aG docker pi
. Close the SSH connection and ssh in again to get the usergroup updated in the new session. Finally test docker to ensure it's working with docker run hello-world
Now we need to install docker-compose
.
# Install python and tools
sudo apt-get -y install python-setuptools
# Install pip
sudo python /usr/lib/python2.7/dist-packages/easy_install.py pip
# Use pip to install docker-compose
sudo pip install docker-compose~=1.23.0
With docker-compose
installed, from here you can follow Steps 3 and 4 in the following link to setup the docker compose manifest and to start the server: https://github.com/oznu/docker-unms/wiki/UNMS-on-Raspberry-Pi#3-create-docker-compose-manifest . You're done and can access UNMS at https://PI_LOCAL_HOST
Certainly, I dont see why a container wont work. If I could rewind time, I'd attempt a containered unifi first. I wasn't too familiar with docker at the time I installed Unifi and only started exploring it since UNMS wasn't working for me otherwise. If you give it a shot and document your experience, I'll gladly link to it for reference.