Installing Unifi Controller on a Raspberry Pi in 5 min

I have some smart products at home and one of the things I wanted to do is read out the connected WiFi devices. To do this I need to Unifi Controller to be running 24/7, so I needed a device to run the Unifi Controller on, something small, cheap and with low running costs. That’s where the Raspberry Pi comes in. In this article, I will help you installing the Unifi Controller on the Raspberry Pi step-by-step in 5 minutes.

To get started you need a Raspberry Pi of course and install Raspbian (lite) on it. We will be using Noobs for the installation and run Raspbian Lite on it to save resources. (we don’t need the desktop 😉 )

What do we need?

To get started you need some items. If you already have a Raspberry Pi you can skip this part and continue on installing Raspbian or straight through installing the Unifi Controller. I had a Pi 1 Model B lying around, which is working fine. But if you have to buy one, get yourself a Pi 3 Model B.

Part list

Step 1 – Getting the Raspberry Pi up and running

The easiest way to install Raspbian on the Pi is by using Noobs and connect the Pi to your TV and wire connected it to the internet. First, we have to prepare the SDCard by formatting it using the SD Association’s Formatting tool

  1. Download the SD Memory Card formatter from
  2. Install the SD Card formatter and start it up
  3. Insert the SD Card in your computer and do a quick format

Once the SD Card is prepped we can download and unpack Noobs Lite on it. Noobs lite requires the Pi to be connected with the internet. If that is not an option for you, just download Noobs (which is an online and offline installer).

  1. Download Noobs Lite from
  2. Raspberry Pi install NoobsExtract all the files to the formatted SDcard

Now it’s time to install the Pi:

  1. Insert the SD card in the Pi
  2. Make sure the keyboard (and optional mouse) is connected
  3. Plugin the HDMI cable to your monitor or TV
  4. Connect to power

Noobs will start up and let you choose which OS you want to install. Because we are only using the CLI, we can pick Raspbian lite to save resources of the Pi. When completed the Pi will reboot and will ask you to login:

Username: pi
Password: raspberry

Step 2 – Connecting with SSH

To make working on the Raspberry Pi a bit easier, so we don’t need to plug in a keyboard and screen every time, let’s enable SSH. This way we can work on it from our computer remotely:

Type the following command to open the settings page:

  • Select Advanced options
  • Scroll down to SSH and press enter to enable it
  • When down press ESC to exit the settings page.

Settings a static IP address

By default, the Pi is using DHCP to get an Ip address. This means that a reboot can cause it to get a new Ip address, which will make it hard to manage it with SSH or to open the Unifi Controller.
So we are going to set a static Ip Address on the network interface:

  1. First let’s check what the current address is, type: ifconfig
    In the result below you will see eth0 and in that block inet: 192.168.x.x. This is the current ip address.
    Set static ip address on Raspberry Pi
  2. Type:  sudo nano /etc/dhcpcd.conf  to edit the config file
  3. Enable to following lines by remove the # from it and set ip address to a fixed value

    In this case, we set the IP address to and the address of the internet router is You also need to set the domain_name_servers, by default entering the router’s address is enough.

    Which ip address should you pick? If you don’t know your network layout, keep the first 3 parts of the address the same and choose a value between the 200 and 240 at the end.

  4. When done save and close the file by pressing ctrl + x and choose Y to save it.
  5. Now we need to restart the network interface to apply to new settings:

Connecting to the Pi with SSH

So we are now ready to remotely manage the Raspberry Pi over SSH. You will need a client for this, I suggest Putty is the best tool for the job.

  1. Download Putty
  2. After installing Putty start it and enter the Ip Address from you Pi in the address bar.
  3. Click on Open, the prompt will ask you to login (pi and raspberry)

You can unplug your Tv now, so the rest of the family can use it. We will be working with Putty for the rest of the installation.

Updating you Raspberry

The last step before we can begin to install the Unifi Controller, make sure the Raspberry it up-to-date.  First, we will update the firmware:

This may take a while, just sit back and grep a coffee.
When done we will update Raspbian:

When complete we can start with the next step, installing the controller.

Step 3 – Installing the Unifi Controller on the Raspberry Pi

  1. All Linux distros come with a source list, repository, of available packages to install. Unifi Controller is not listed in the default repositories, so we need to add it first:
  2. To install the Unifi Controller software we need to authenticate the software that it’s the real software from Ubiquiti. This is done by validating a key with the key server.
    First, we need to install a certificate management service:
  3. Then we can add the key to our Raspberry Pi
  4. We now have added the software to our list of available software and have the ability to check its authenticity. So let’s download the software and install the Unifi Controller on the Raspberry Pi together with the required Java software.
  5. The installation may take a couple of minutes to complete. When done, we need to remove the default database that comes with MongoDB instance. This would only waste resources of our Pi, so we get rid of it:
  6. The only step left is to reboot the Pi
Unifi Controller Raspberry Pi

Wrapping up

After the reboot, you can log in to the Raspberry Pi with your browser. Goto the Ip address you set earlier:

The setup wizard page will be displayed allowing you the create a new site or restore a backup. Check this post on some tips on how to optimize your controller or how to add the access points.

Keeping the Unifi Controller up to date

It’s important to keep your network products up-to-date. New firmware contains important security fixes, fixes bugs in the software and can enhance the performance of a device. Check out this post on how to update the Unifi Controller and signup to the newsletter. I will drop you an email when there is a new version available!

Blank screen due to old Java Version

Starting with version 5.10.12 from the Unifi Controller you may get a blank screen after installing everything. This is because 5.10.12 requires at least Java 1.8.0_201. Rasbian is shipped with an older version of Java by default.

To update your Java version you can follow this guide.

See also:

Get more stuff like this

IT, Office365, Smart Home, PowerShell and Blogging Tips

I hate spam to, so you can unsubscribe at any time.

33 thoughts on “Installing Unifi Controller on a Raspberry Pi in 5 min”

  1. Just a note to those using these instructions – they worked brilliantly the first time, but when I came to upgrade Unifi Controller versions I ran into two issues. First, the java version was out of date and the new version just failed to start and I had to follow the instructions here to update the JDK:

    Guide to update Java also here on LazyAdmin

    I also had an issue where restoring a backup configuration didn’t work. Looking at the logs it seemed that it wanted to use mongodb to do some of the database migration, but these instructions disabled it. I re-enabled it and repeated the process with success.

    Hope that helps someone.

  2. Very nice tutorial, thank you. It worked perfectly on my older Pi 2.
    One error :
    on #4, you have
    sudo apt-get update sudo apt-get install unifi oracle-java8-jdk -y
    it should be
    sudo apt-get update && sudo apt-get install unifi oracle-java8-jdk -y

  3. Errors during installation:

    apt-get update
    Err stable/ubiquiti armhf Packages
    301 Moved Permanently [IP: 80]
    Ign stable/ubiquiti Translation-en
    W: Failed to fetch 301
    Moved Permanently [IP: 80]

    E: Some index files failed to download. They have been ignored, or old ones used instead.


    apt-get install unifi
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    E: Unable to locate package unifi

  4. Note, default Oracle JRE is 8u65….should probably just forget the oracle JDK in the article.
    sudo apt-get install openjdk-8-jre-headless

  5. I have the same problem as James.

    I have followed all of the instructions but, when I go to the final stage of viewing this in the browser it shows nothing (I know that the pi is there on the ip address as I can putty into it).

    unifi is already the newest version (5.10.17-11638-1).
    oracle-java8-jdk is already the newest version (8u65).

    What could be the problem?

  6. Rudy,

    You posted on 12th Feb
    “You can follow this guide to update Java on the Raspberry Pi”

    There was nothing to follow.
    Can you re-post what version of java we need to make this work with the latest version of Unifi controller?

    Great article.


  7. First of all, I wanted to say “Thank you so much for this”.
    I have used this guide in the past and it worked flawlessly. However, today I am having some difficulties. I have followed all of the instructions (to the best of my knowledge – I am not a command line person!) and everything seems to go well, however, when I go to the final stage of viewing this in the browser it shows nothing (I know that the pi is there on the ip address as I can putty into it). It is like the unifi software is not running on the pi or something similar.
    Any help gratefully received.

      • Hi Rudy,

        thank you for this. I will have time to start from the beginning at the weekend. I did quickly try (I had to install vim as for some reason I did not have this already working – could this have worked with tee?) but did not have the time to start from scratch. I really do appreciate your time on this (as I really don’t want to have to buy a cloud key!). If I run into any more issues I hope it will be ok to post them here.


      • Rudy,

        thank you for your help. I started from scratch and followed all of the instructions but I have run up against “This site can’t be reached refused to connect” when trying to get to the Pi on the browser. I wonder if there is something stopping me browse to the pi (when I can SSH to it if needed)?


  8. I have followed så many guides to install Unifi controller on Raspberry. They all work, but the controller allways stops working after some time. Needs to be restartet daily. After some time its completely broken and you need to start all over reinstalling everything. I have done this fve times now 🙁

    I guess Raspberry Pi cant handle this?

  9. Thanks a bunch, really useful guide you have there, especially for someone thats new to the command line like me.

    However, I did encounter an error whereby I was not able to update after adding the key. Error message as below:

    [email protected]:~ $ sudo apt-get update
    Hit:1 stretch InRelease
    Hit:2 stretch InRelease
    Get:3 stable InRelease
    Err:3 stable InRelease
    Clearsigned file isn’t valid, got ‘NOSPLIT’ (does the network require authentication?)
    Fetched 59 B in 1s (29 B/s)
    Reading package lists… Done
    E: Failed to fetch Clearsigned file isn’t valid, got ‘NOSPLIT’ (does the network require authentication?)
    E: Some index files failed to download. They have been ignored, or old ones used instead.

    Any idea how to go about this?
    Thanks again!

  10. You can simplify installation somewhat and avoid cluttering up your Pi with openjdk by rearranging the command order:

    echo ‘deb stable ubiquiti’ | sudo tee -a /etc/apt/sources.list.d/100-ubnt.list > /dev/null
    sudo apt-get -y install dirmngr
    sudo apt-key adv –keyserver –recv 06E85760C0A52C50
    sudo apt-get update
    sudo apt-get install unifi oracle-java8-jdk -y
    sudo systemctl stop mongodb
    sudo systemctl disable mongodb
    sudo reboot

    Apt happily resolves the dependencies of the unifi package and allows installation without grabbing the full openjdk package.

  11. Is it possible to install the Unifi Video controller software as well into the PI along side the Unifi controller software?

  12. Brilliant article thank you!!! Worked perfect first time and saved me alot of typing (by using SSH putty paste) and alot of possible hassle since I am no Linux pro whatsoever (I am an IT Windows guy). I did a for more updates and upgrades than in your article just because but also your command to update the firmware – brilliant.

  13. Thanks for sharing. I followed all the steps and everything seems going fine up to the last step, except that when I go the IP address of the Raspberry, port 8443, it shows a blank page and there’s an error logged in the browser console:

    Uncaught Error: [$injector:modulerr] Failed to instantiate module app-unifi-wizard due to:

    Error: [$injector:nomod] Module ‘app-unifi-wizard’ is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.

    Never had a similar issue?

    • In this case I would just reboot and run the install and update steps again. Just to be sure you have the latest versions.

      First try update only:
      sudo apt-get update && sudo apt-get upgrade -y

      Run the install again:
      sudo apt-get install unifi -y

      Of nothing works, then format the SD and start over.

          • Just updating and installing didin’t work, I repeated all the steps except for the initial ones, as I directly flashed a Raspbian Lite image to the SSD (instead of using NOOBS). It initially gave me the same error, but after a few minutes it worked fine, showing the wizard. I’m not sure if it could have worked even the first time, if I only had waited a few more minutes.

  14. I agree great guide. Easy to follow. Thanks a lot.

    Just one thing: to enable SSH in raspi-config you have to go to “Interfacing Options” not “Advanced Options”.

    And don’t forget to do updates!

Leave a Comment