Install UniFi-controller on Raspberry-Pi

UniFi is a really good brand from Ubiquiti for network equipment (no sponsorship, just my feeling) in particular for home and small businesses. It comes with a controller to manage the whole network. This controller can be deployed on a small computer like raspberry Pi. It runs mongoDB, Java, so I recommend to use a PI4.

I was running a UniFi controller on my RPI4 since a while… But I had the wrong idea to apt-get upgrade the system and it crashed… Why ? Mostly because the controller distribution is a bit a mess with the MogoDB version and the 32b / 64b, but at the end you’re stuck.

So I’ll describe here how to install the controller in a proper way with docker.

Setup system

For the installation, I used a Raspberry PI 4 with XXGB for memory and 128GB SDCard (64GB is good enough but today 128GB is same price), I recommend to use a good quality SDCard to avoid future problems.

The RaspiOS Lite 64b distribution is good, get the latest one and flash it. Balena Etcher tool is perfect for this.

Setup a static IP:

[root@pi:~] nmcli mod show
NAME                UUID                   ...
Wired connection 1  1d9c4760-0d61-3097-aa0e- ...

[root@pi:~] nmcli con mod "Wired connection 1" ipv4.addresses x.x.x.x/24 ipv4.gateway x.x.x.y ipv4.dns 1.1.1.1 ipv4.method manual
[root@pi:~] systemctl restart NetworkManager

Update the raspiOs

[root@pi:~] apt-get update 
[root@pi:~] apt-get upgrade
[root@pi:~] reboot

Install docker

[root@pi:~] curl -sSL https://get.docker.com | sh

Get UniFi controller

to get UniFi controller on docker, I used the project made by jacobalberty on github it contains a docker-compose file with the full setup

[root@pi:~] git clone https://github.com/jacobalberty/unifi-docker.git
[root@pi:~] cd unifi-docker/
[root@pi:~] docker compose up -d

Startup takes a while, so if you get a 404 when connecting on https://XX.XX.XX.XX:8443/, just wait a bit. Your browser may warn you about the certificate also. It is self signed, nothing not normal.

One thought on “Install UniFi-controller on Raspberry-Pi

  1. This is a fabulously simple way of installing Unifi on a Pi.

    Wondering why other sites make it so complicated!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.