Installing the UniFi Controller on the Raspberry Pi

With this tutorial, we will be showing you the process of installing the UniFi Controller on a Raspberry Pi

Raspberry Pi UniFi Controller
UniFi is a range of network devices created by Ubiquiti. These devices range from Wi-Fi access points to security gateways and switches.

Setting up the UniFi software on a Raspberry Pi is a fairly straightforward process as it just relies on the multi-platform Java runtime to run.

Using the UniFi network controller, you can manage all the UniFi devices that are a part of your network. You will also be able to use this dashboard to see the statistics of your UniFi network.

Equipment List

Below is a list of the equipment that you will need to set up the Unifi Network Controller software on your Raspberry Pi


Raspberry Pi 1, 2, 3 or 4

Micro SD Card

Power Supply

Ethernet Cord or WiFi dongle (The Pi 3 and 4 has WiFi inbuilt)


Raspberry Pi Case

This tutorial on setting up the UniFi Network Controller was tested on a Raspberry Pi 4 running the latest version of Raspbian Buster.

Preparing your Raspberry Pi for the UniFi Controller

In this section, we will be preparing the operating system so it can run the UniFi software.

1. The first thing you should do is ensure that your Raspberry Pi is running up to date packages.

To update all packages, you will be required to run the following command.

sudo apt update
sudo apt upgrade

2. Next, we need to install version 8 of the Java runtime environment to our Raspberry Pi by running the command below.

We need to install Java as the UniFi Network controller requires it to run.

sudo apt install openjdk-8-jre-headless

As of the time of posting, UniFi does not support newer versions of the Java runtime.

3. To improve the startup speed of the UniFi controller software on our Raspberry Pi, we need to install rng-tools.

We will utilize this package to ensure the Raspberry Pi has enough entropy for the random number generation that the UniFi software uses.

sudo apt install rng-tools

4. We now need to make a slight change to the rng-tools configuration.

Begin editing the config file by running the following command.

sudo nano /etc/default/rng-tools

5. Within this file, find and uncomment the following line.



Replace With


By uncommenting this line, we are adding to the amount of entropy (The amount of randomness) that the system has available.

The Raspberry Pi features an integrated random number generator that we can utilize to increase the entropy pool.

6. Once you have made the change, save the file by pressing CTRL + X, then Y, followed by ENTER.

7. Finally, restart the rng-tools service by running the command below.

sudo systemctl restart rng-tools

Once the service has finished restarting, it should now be safe to proceed to the next section of this guide.

Installing the UniFi Controller to the Raspberry Pi

1. Our first task is to add the UniFi repository to our sources list.

We can achieve this by running the command below.

echo 'deb stable ubiquiti' | sudo tee /etc/apt/sources.list.d/100-ubnt-unifi.list

2. We now need to add the repositories GPG key by using the following command.

sudo wget -O /etc/apt/trusted.gpg.d/unifi-repo.gpg

The GPG key is what helps tell the package manager it is downloading the correct package.

3. As we made changes to the repositories, we need to now update the package list by running the command below.

sudo apt update

4. Now finally, we can install the Unifi Controller software to our Raspberry Pi by running the following command.

sudo apt install unifi

Installing UniFi through this method will automatically set up a service. This service will automatically start the UniFi software at boot.

First Boot of the UniFi Controller on your Raspberry Pi

In this section, we are going to walk you through the initial configuration steps of the UniFi software.

1. First, retrieve the local IP address for your Raspberry Pi.

If you have terminal access to your Pi, you can use the following command.

hostname -I

2. With your Raspberry Pi’s IP address handy, go to the following web address in your favorite web browser.


If you run into a certificate error, it is safe to ignore it as we know what device we are connecting to.

3. The first step requires you to give a name for your Raspberry Pi powered UniFi controller (1.).

You are also required to agree to the end-user license agreement and terms of service from UniFi, once you have read through them, click the checkbox (2.).

Once all done, click the “Next” button (3.) to proceed.

Set Name of UniFi Network

4. Next, you will need to sign in to your Ubiquiti account (1.).

If you don’t already have an account, you can register at the Ubiquiti website.

Once you have entered your login details, proceed by clicking the “Next” button.

Sign in to Ubitquiti Account

5. Tweak the settings on this page that best suits your needs.

Once configured, click the “Next” button.

UniFi Network Setup

6. Use this screen to connect your Pi UniFi Network controller to the devices on your network.

To proceed, click the “Next” button.

Connect Raspberry Pi to UniFi Devices

7. Now give your new Wi-Fi network a name and a password.

Once you have configured your WiFi details (1.), click the “Next” button to proceed (2.).

Setup UniFi WiFi Details

8. This final screen will get you to review all your settings.

You will also be able to use this screen to set both the country and timezone (1.). Make sure you set these before continuing.

Once you have verified everything is correct, you can now click the “Finish” button (2.) to finish the setup process.

Review Raspberry Pi UniFi Configuration Settings

7. At this point, you should now have successfully set up the UniFi network controller on your Raspberry Pi.

Raspberry Pi UniFi Dashboard

If you have run into any issues with setting up the UniFi software, feel free to drop a comment below.


  1. Avatar for Marko
    Marko on

    How do you update the Controller version now? or does it do it within itself by auto ?
    I ran the older version on TrueNAS linux server and had to do it myself back in the days before i transfered to Pi …

    1. Avatar for Emmet
      Emmet on

      Hi Marko,

      As we are installing Unifi from their repository all you need to do to update it is to run the following two commands.

      sudo apt update
      sudo apt upgrade

      If their is an update available from Unifi it should be updated as part of the upgrade process.


  2. Avatar for Michael L
    Michael L on

    FYI the rngd step is no longer needed as it is installed and running by default, at least on my newly installed Pi 4. It seems that the init script autodetects the correct hardware device to use.

  3. Avatar for Sennai
    Sennai on

    Thanks for this tutorial. Well written and easy to follow.
    Worked for me. Controller is running along with Pihole.
    8Gb Memory usage was 2% before Unifi, with Unifi it’s now at 7.1%.
    Backed up the config from the old Unifi controller that was running on Mac Laptop and restored it to the new controller on RPi. Then, “Forget” all my devices one at a time from the old controller and the new controller adopted them automatically.

  4. Avatar for Olivier
    Olivier on

    Thanks. Great tutorial, worked first time. I had initially installed the Unifi Controller on my Macbook Pro (version 6.1.71) and the transition worked perfectly. I backed up from the old controller and then restored from backup when installing the new controller on my Raspberry Pi (Raspberry PI OS Lite, headless)

  5. Avatar for Daniel
    Daniel on

    This worked perfectly, thanks for the clear instructions! I couldn’t find an installer for Raspbian Buster, so I got it running on a Raspberry Pi 4 with Raspberry Pi OS Lite.

  6. Avatar for Daniel
    Daniel on

    Are there any requirements in terms of RAM or SD storage that we should keep in mind when buying the hardware?

    1. Avatar for Emmet
      Emmet on

      Hi Daniel,

      As always for the best experience, more resources are always good. I would personally at least try to stick with the Raspberry Pi 4 with at least 2GB of RAM.

      SD storage wise you can’t go to wrong with a 32GB card, they are reasonably affordable these days. It gives you some extra room to store logs produced by the UniFi controller software.


  7. Avatar for Jon
    Jon on


    Thank you for the very excellent, detailed instructions. If only everything I was trying to do had instructions this thorough and well written. Sometimes if I’m lucky I find instructions that tell me what to do but never do I find instructions tell also tell my why I am performing each step.


  8. Avatar for Steven
    Steven on

    I’m a bit unsure what the HRNGDEVICE=/dev/hwrng config option actually does. Could you explain why you chose to uncomment this?

    Great tutorial!

    1. Avatar for Emmet
      Emmet on

      Hi Steven,

      By uncommenting this line we are letting the rng_tools use the Raspberry Pi’s inbuilt hardware number generator.

      This increases the entropy available to the operating system . This helps certain software like UniFi complete tasks faster that requires a certain degree of randomness.


  9. Avatar for Evan J Meidell
    Evan J Meidell on

    This is awesome! Though how do I update the controller now that its been up for a while? Just follow the install steps again?

    1. Avatar for Emmet
      Emmet on

      Hi Evan,

      As we added the package repository you should be able to just run the following two commands whenever an update is available.

      sudo apt update
      sudo apt upgrade


  10. Avatar for Janro
    Janro on

    Can I install older version (5.6.42) of Unifi controller?
    My UniFi AP-AC v2 is not supported in newer versions:(

    1. Avatar for Emmet
      Emmet on

      Hi Janro,

      Yes you definitely can.

      Of course we won’t be able to install it using the repository so you will need to follow a different set of instructions to what we do in the tutorial.

      1. We need to first download the 5.6.42 version of the Unifi Controller to the Raspberry Pi.


      2. Once the package has downloaded to the system, we can install it by running the following command.

      dpkg -i unifi_sysvinit_all.deb

      3. With it downloaded we can remove the old version of the package.

      rm unifi_sysvinit_all.deb

      4. You should now be able to continue on with the tutorial.

      PS. If you have already installed Unifi following the original instructions you should be able to remove it by running the command below.

      sudo apt purge unifi
  11. Avatar for Jeff in Texas
    Jeff in Texas on

    I followed your process and the controller would not start due to an issue with mongodb. After searching a while (and posting to reddit) I entered these two commands after installing but before rebooting:
    sudo systemctl stop mongodb
    sudo systemctl disable mongodb
    I think that there is a version of mongodb that comes with Buster and a different, incompatible version that is installed with Unifi. The command lines stop and disable the pre-installed version so there is no conflict.
    But I may not understand the details completely.

  12. Avatar for Tony
    Tony on

    Wow what a great tutorial. Worked perfectly first time. Had previously spent a whole day messing with Unifi on my windows 10 pc and network to no avail. Installed this on my old spare Pi3 and it only took less than 15mins to be all up and running.
    Many thanks.

  13. Avatar for Charly
    Charly on

    Thanks for this tutorial.
    Well explained and it worked right away !!

  14. Avatar for Christoph
    Christoph on

    The only tutorial which worked for me.
    Many thanks!

  15. Avatar for Zeke
    Zeke on

    great step by step instructions! works like a charm!

  16. Avatar for Frank
    Frank on

    I always install UFW on my Rpis. That caused me a bit of trouble this time. But for those that want a firewall, I had to open ports 22, 8080, 8443, 8843, 8880, 8881 and 27117 (per an old post in the Ubiquiti forums).

    Thanks for the very helpful instructions!

  17. Avatar for Gabe
    Gabe on

    I spent a long time trying to set the ubiquiti controller up on my Windows PC to no avail. This tutorial was easy and I was up and running in no time!

    Thank you so much!

  18. Avatar for sean flynn
    sean flynn on

    That fixed it, thanks Emmet.
    Kind of disconcerting that certain mirrors have bad images.

  19. Avatar for sean flynn
    sean flynn on

    When I get to “sudo apt install unifi” it fails to install with many messages like the following:
    File has unexpected size (32768 != 31176). Mirror sync in progress? [IP: SNIPPED]
    Any ideas? TIA

    1. Avatar for Emmet
      Emmet on

      Hi Sean,

      That looks like there is an issue with the mirror the operating system is trying to download from.

      You can either wait and hope it eventually fixes itself (Will likely need to run another sudo apt update) or change it to another mirror manually.

      You can follow our guide on changing the Raspbian repository if you decide to go down that route.


  20. Avatar for Jonathan
    Jonathan on

    On step 2 under installing the UniFi controller software I keep getting the following message when running the sudo apt-get update command:

    N: Skipping acquire of configured file ‘ubiquiti/binary-arm64/Packages’ as repository ‘ stable InRelease’ doesn’t support architecture ‘arm64’

    I can’t seem to get past this and after googling around I can’t seem to find anyone with the answer to solve the issue either.

    Any thoughts?

    1. Avatar for Emmet
      Emmet on

      Hi Jonathon,

      Are you trying to install this in a 64bit operating system?


    2. Avatar for Jonathan
      Jonathan on


      I was using 64 bit ubuntu but I went back to Raspberrian Lite and it works great now!



Leave a Reply

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