If you click our links and make a purchase, we may earn an affiliate commission.
Learn more
I’ve managed access points for years as a sysadmin, and once you have 10+ devices connected, it can quickly become a nightmare. UniFi solved that problem for us, but its dedicated gateways can be expensive. The good news is that a Raspberry Pi can handle the controller role instead. Here’s how to set it up.
The UniFi Network Application can be installed on Raspberry Pi by adding a Debian repository and using apt to install the required packages. A .deb package is also available directly on the website. Configuration can then be done via a convenient web interface.
The installation itself is straightforward. You can install it like any Debian package. But the access points configuration is not so easy, and I saw no article explaining this. As I’m using it at work, I can show you all the configuration steps with real access points and clients. Let’s see how to do this!
Ubiquiti Networks is an American company, selling hardware for wireless technologies like access points, routers and cameras.
They started with wireless devices, and they are now diversifying upon a broader range of products. The latest innovative product concerns solar technology that helps you to manage solar farms.
Anyway, the product that interests us today is their popular UniFi line of wireless network devices. These will be controlled by a software: UniFi Network Application (which used to be known as the UniFi Controller in the past).
The goal of the Unifi Network Application is to manage multiple access points and wireless devices from a single web interface. From there, you can see all the access points and broadcast a unique SSID. The controller will handle the roaming between access points and load distribution.
Why Do I Need These Products?
These products target mainly companies and large areas but you can have the same “prosumer” needs at home if you have issues with your Wi-Fi connection (rooms with no network, roaming, stability, etc.).
Before switching to Ubiquiti products, I remember having tested many brands to solve my issues, but none of them could support over 10-20 users simultaneously (I even tested a fireproof model from D-Link, something like this one on Amazon ^^). So, I definitely recommend trying Ubiquiti, as it’s inexpensive compared to enterprise brands but performs very well.
Something not working as expected?
You can get answers from real experts in minutes. Get help with your setup
For example, let’s say you need three access points at home. If you turn your Raspberry Pi into a Unifi controller, you will only have one Wi-Fi SSID (outdoor included)—instead of three. And you can move from one side to another without disconnection.
Ubiquiti Products
Ubiquiti products are distributed by resellers but are also available on several e-commerce sites:
To test these products, you don’t need many things. Just buy one or more access points and build your professional wireless network. Here is the link: Ubiquiti UniFi AP on Amazon.
You have several packages available: Only one, 2 AP (access point), 4 AP, etc. Choose the one you prefer, but there aren’t big savings for buying bulk, so you can start with one or two, and order the others after.
Whatever your choice, a PoE switch will make the installation easier. If you want to start without it, there’s another option: Ubiquiti provides an adapter with the AP (power cord + network = PoE Network), but you need a power outlet and two RJ45 cables instead of only one cable for everything.
Here is the link to the PoE injector on Amazon, make sure to check the AP power requirements are they are not all the same (a Pro AP needs PoE-48 for example).
UniFi Network Application Installation
Now that you understand what UniFi products are, we can move on to setting up the software. Here’s an overview of how to turn your Raspberry Pi into a UniFi controller:
Bonus tip: If the terminal still feels confusing, I made a simple cheat sheet with 74 commands explained in plain English. You can grab it here for free..
Recommended next step
Master Raspberry Pi in 30 Days
If you want a clearer path than jumping from tutorial to tutorial, my book gives you a step-by-step roadmap to really understand your Raspberry Pi.
Download the Unifi Network Application autoinstaller script.
Run the UniFi autoinstaller script.
Don’t worry, I’ll explain everything in detail next.
Installation on Raspberry Pi OS
As for any tutorial on this site, you first need to install Raspberry Pi OS on your Raspberry Pi. Any version will do (I’m using Raspberry Pi OS Lite). If you don’t know how to do this, read my article on How to install Raspberry Pi OS on your Raspberry Pi.
Once installed, update your system and reboot: sudo apt update sudo apt upgrade sudo reboot
Tip: Command lines can be a pain to memorize. I put the essential Linux commands on a printable cheat sheet so you don't have to keep googling them. You can grab the PDF here if you want to save some time.
Set a Static IP Address
As our Raspberry Pi will act as a server on our network, we need to use:
A wired connection If you want a fast Wi-Fi network, you need to have your controller and your access point on a good connection. So, I don’t recommend setting up the controller with a Wi-Fi connection. Check this tutorial if you need help with this step: How to Connect the Raspberry Pi’s Ethernet Port (2 ways).
A static IP address The Raspberry Pi will become an important node on your network, so we need to fix its IP. By default, the Raspberry Pi uses DHCP to get a random IP among those available.
You can either set a static IP in the DHCP server (on your router probably) or do so from the Raspberry Pi configuration. If you don’t know how to do this, I already explain it at the end of this article. Feel free to take a look before going further: Set a static IP address on your Raspberry Pi.
UniFi Network Application Installation
Now that your Pi has a static IP, we’re ready to start the installation.
Note: Unifi Network Application requires dependencies that often conflict on Raspberry Pi. Workarounds have gotten messy, so to make things easier, we’re going to use an automated installer script.
This script is provided by GlennR, who has maintained it for the last eight years.
Here’s how to install UniFi Network Application on Raspberry Pi:
Find the most recent script available on GlennR’s page: here. The script detects your Linux distro and even works on Raspberry Pi OS.
Copy the link for the newest versionand download it using wget: wget https://get.glennr.nl/unifi/install/unifi-10.5.67.sh
Run the script using the filename you downloaded: sudo bash unifi-10.5.67.sh
The script will initiate and a splash screen will appear. The script will detect your Raspberry Pi (and use special steps for its hardware). It will begin by installing a few prerequisite packages.
You’ll then be asked a few setup questions:
Do you want to automatically upload the support files? N
Do you want to keep the script on your system? Y
Which software do you want to install? 2 (UniFi Network Application)
Would you like to use compiled MongoDB? Y
Do you want to proceed with updating your system? Y
Then comes the most important part: the script will begin installing dependencies (mainly MongoDB and Java) that will be compatible with your system.
Finally, the Unifi Network Application is installed. At the end, it provides the link you will use to access the admin portal in your browser.
Now that the installation is finished, let’s check if the UniFi server is online: systemctl status unifi
Success! If everything is good, move on to the next section to learn how to use it.
UniFi Controller Configuration
In this section, you’ll learn how to configure the UniFi Network Application. More specifically, we’ll be going over how to:
Access the web admin portal.
Add an access point.
Create a wireless network.
Let’s cover each step in detail.
First Access
To access the web interface, go to https://<IP>:8443 You should have gotten this link at the end of the installation earlier. For example, in my case it’s https://192.168.30.19:8443/
Don’t forget the https:// or you’ll get an error saying “bad request…requires TLS.” When the page loads, you’ll get a warning because we don’t have a secure certificate. This is normal. Approve the exception to continue.
Now you’ll be asked to configure the initial settings for your server:
Log in to your UniFi account. It depends on what you’re trying to do here.
If you need access to the cloud interface, which is useful for administering remote sites, you’ll want to Create Account and then log in with your UI Account.
If you’re always on the same network (at home for instance) and you don’t need the cloud panel, like me, you can click Advanced Setup > Skip to avoid having to create an account. You’ll then be asked to create a local account for logging in.
Step 3: After you complete whichever path you chose above, you should be done and will now be redirected to your dashboard.
Good job! We can finally see it and configure more things if needed.
Web Interface Overview
Once logged in the web interface, you’ll get many submenus to manage everything. For the moment, it should be pretty empty, but in the left bar you can see:
Dashboard: Here you can have a preview of your network, like the number of APs, clients, and your network performance.
Topology: In this one you can upload a map of your building, and place all APs on it. This way you can know where they are and see the global Wi-Fi coverage (approximately).
UniFi Devices: This page shows you all the UniFi network devices you have on your network. It’s the most important page, you will manage APs from here.
Clients: Same thing except for the clients. You’ll see here all the connected clients with information about them (IP, AP, network usage, …):
Insights: Here you can see miscellaneous information. I’m using this mainly to see known clients (not connected now, but you can check the history, block or unblock them).
Admins: this page lets you manage which users can administer this portal.
Settings: It’s pretty important so I don’t know why this is at the very bottom. This is the page where you’ll configure everything. We’ll use it to create the wireless network.
Logs: Here you can read through logs to find out if there’s something wrong.
Now that you have visited the whole interface, we can move forward to configure the access point.
Add the First Access Point
Physical Preparation
There are two possibilities for the access point cabling.
With a PoE switch:
Plug the access point to the POE Switch with an RJ45 cable.
Basically, that’s it. The status light should turn on and you can move to the next step.
Bonus tip: If the terminal still feels confusing, I made a simple cheat sheet with 74 commands explained in plain English. You can grab it here for free..
Without PoE switch:
You must have a POE adapter like this: (it’s available on Amazon if you don’t have one with your access point: check it here).
Connect the LAN port to your switch or wall network socket.
Connect the POE port to the access point.
If the access point LED starts to blink, it’s ok.
Software Configuration
Now that we powered on the access point, we can go back to the Unifi web interface for the next steps:
Access the web interface: https://IP:8443.
Click on UniFi Devices in the left menu.
You should now see your access point in the list: The controller is seeing it, but we need to tell that it’s an access point for this controller.
Click on “Adopt” at the end of the line. The adoption process starts, after a few seconds, you should get the “Connected” status.
If needed (probably), you can upgrade the AP firmware to the latest version by clicking “Upgrade”. Your access point will take a few minutes to download and update the firmware.
Anyway, the first access point is ready, and we can now create the wireless network (SSID).
You can click on the line to see and change other settings for the access point (on the right).
For example, you can set an alias for each access point to know which one is which. In the properties window, click on the config tab and set an alias.
Change everything you want on the access point and move to the SSID creation.
Create a Wireless Network
Creating a wireless network is basically setting an SSID, a password and a security type. You can do this in the “Settings” menu from the left bar:
Go to Settings and click on WiFi.
Then click the Create New button:
In the new window, choose an SSID name, a network passphrase (preferably a long one from 15-30 characters, so your Wi-Fi doesn’t get hacked), and lots of other options, like if you want to broadcast dual-band.
If you want to tweak even more settings, change Advanced to Manual. There you can choose what security type you want, like WPA2/WPA3.
When you’re done, click Create at the very bottom to save.
The access points will restart with the new settings. After a few seconds, the new wireless network is available for all your devices.
Connect to it and check that everything works fine. By default, the Unifi controller will give you an IP address within your main network. You have nothing else to do, but you can change it in Settings > LAN.
Then go back to the different menus to see information and statistics about your device. Enjoy 🙂
That’s it, you know how to install and configure a Unifi controller on your Raspberry Pi. This controller is running perfectly on my Raspberry Pi (3B+ and 4). I don’t know how many clients it would handle, but at home it’s more than enough.
🛠 This tutorial doesn't work anymore? Report the issue here, so that I can update it!
Stuck on this project? Ask me or other Pi users in the RaspberryTips Community. We help each other out and you'll get answers quick. Join and fix it together.
GlennR, the script’s maintainer, also provides an easy update script:
Download the Unifi Network Application updater: wget https://get.glennr.nl/unifi/update/unifi-update.sh
Run the script: sudo bash unifi-update.sh
If you want this easy script to keep working on your Pi in the future, consider supporting GlennR. He makes new versions for every update that you can find here.
Do I need to keep the Raspberry Pi on?
Not really. As soon as the Raspberry Pi stops, the controller admin portal is no longer accessible but the access points will continue to work. You can still access the Wi-Fi network, but you lose controller’s features like roaming between APs.
Does the UniFi server have advanced features you didn’t mention?
Yes, way too many. I made a quick tutorial, but you can do a lot more: schedule downtimes, create guest access with VLAN or not, Radius with Active Directory, filter MAC address, block and unblock clients, etc …
How do I reset a UniFi access point?
If you lose access to an access point or have strange scenarios in the adoption process, you can reset it to factory defaults. To do this, use the reset button near the RJ45 socket. While the access point is on, let the button pressed for 10 seconds and then wait for the reset.
Even when you follow every step, small differences in OS version, hardware or config can change the outcome. Instead of wasting time guessing, get help from people who have already fixed the same kind of issue.
Founder of RaspberryTips.com.
After working as a web developer and Linux system administrator for over 15 years, he now helps Raspberry Pi users through detailed tutorials, books and courses.
If you click our links and make a purchase, we may earn an affiliate commission. Learn more I’m always looking for new projects to add to my self-hosted Pi cluster, and I’ve recently been wondering how to organize my personal photos and videos. They’re spread across different devices, and I don’t want to upload my…
If you click our links and make a purchase, we may earn an affiliate commission. Learn more You may want to launch a script or program on boot, but you don’t see an option for it on Raspberry Pi OS. It’s a question I often hear about, and the methods are not intuitive. In this…
If you click our links and make a purchase, we may earn an affiliate commission. Learn more After using pfSense for years at work, I wanted to build a similar firewall at home with a Raspberry Pi. It seemed like the perfect combination: powerful software on inexpensive hardware. After digging into it, I quickly discovered…
If you click our links and make a purchase, we may earn an affiliate commission. Learn more The “Low Voltage Warning” or “Under-Voltage Detected” error is a message that you may see frequently on Raspberry Pi. It means that your USB cable isn’t delivering enough power to the Raspberry Pi, so it can’t run at…
If you click our links and make a purchase, we may earn an affiliate commission. Learn more We often use a Raspberry Pi to host personal servers running standalone applications (web interface, media server, etc.), but every installation is different (hence the number of tutorials on RaspberryTips!). FreedomBox is an open-source application that allows you…
If you click our links and make a purchase, we may earn an affiliate commission. Learn more Using a VPN provider to protect yourself on the Internet is becoming increasingly important, but finding one that works well on Linux, and especially on Raspberry Pi, is still a challenge. I tested most of them for a…
16 Comments
Configuration recommendations?
I’ve found that iOS devices seem to have trouble connecting if not close to the AP. The result is incorrect password but the devices connect fine when close.
Seems odd behavior for these enterprise APs.
Thanks
Ken
I have yet to get this awesome (thanks for making it straight forward!) guide to work.. I realize it may be outdated and some dependencies or OS version may be effecting things. Would be great if someone could help update. Im still working at it.. (i have a working install of unifi but had to do it a very complicated way which made a mess out of the install).
Ill post if i figure i out. Otherwise ill use my bloated install for now.
Edit.. Ok well 3rd time is the charm i guess.. I literally ran every command 3x.. and it finally worked when i did an apt update and it gave warnings on how unifi package has been configured multiple times…
Main error preventing me was Signatures could not be verified as public key is not available. Request issues/else? Or does it override after so many attempts to NOKEY?
Hi.
After running through the guide, I’m almost happy.
Things seem to be fine on the Raspberry, but it doens’t answer at port 8443.
How can I verify the installation?
What can be wrong?
I hope you can help me.
Hi Søren,
Did you try HTTP and HTTPS?
I think it’s https by default
sudo service unifi status is running ?
sudo service unifi status
sudo service unifi start
sudo service unifi stop
If it doesn’t work, you can check the logs to find the error (/var/log/syslog for example)
Hello everyone,
For information, I just updated this post
The installation and the welcome wizard was a bit different, so this is now up to date
I couldn’t update the screenshots on the access point adoption process due to the current lockdown. But it should be almost the same
Let me know if you have any issues
Thank you for the article. It was most helpful. The only problem I ran into was access the URL for the controller. IE, Edge, Chrome, Brave all indicated this error: ERR_SSL_VERSION_OR_CIPHER_MISMATCH. Being I had not restarted the RPi after all the steps, I decided to reboot and the problem went away. 🙂 Really great site you have!
Thanks for your feedback Chris!
Great article, thanks!
So quick question. I followed this and have everything working but there is an update to 5.14. I keep getting a message stating
E: Repository ‘https://dl.ubnt.com/unifi/debian stable InRelease’ changed its ‘Codename’ value from ‘unifi-5.13’ to ‘unifi-5.14’
N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.
How can I fix this?
Hi Barry,
Try this:
apt-get update –allow-releaseinfo-change
apt-get clean
apt-get update
If it’s not enough, apt-get dist-upgrade can also do the job
Let me know
Hi, thanks for the article. How can I go about downgrading to 5.x.x as I’m currently on 6.0.23 and I think it’s causing me issues.
Hi,
You can’t downgrade.
But you can uninstall it, reinstall the old version and import and old backup made with the same version.
If you don’t have the backup it’s not possible (or at least you start from scratch and need to reset the APs).
Community members only
Comments are reserved for RaspberryTips Community members. Join the community to ask questions, get help, and interact with other Raspberry Pi users.
Configuration recommendations?
I’ve found that iOS devices seem to have trouble connecting if not close to the AP. The result is incorrect password but the devices connect fine when close.
Seems odd behavior for these enterprise APs.
Thanks
Ken
I have yet to get this awesome (thanks for making it straight forward!) guide to work.. I realize it may be outdated and some dependencies or OS version may be effecting things. Would be great if someone could help update. Im still working at it.. (i have a working install of unifi but had to do it a very complicated way which made a mess out of the install).
Ill post if i figure i out. Otherwise ill use my bloated install for now.
Edit.. Ok well 3rd time is the charm i guess.. I literally ran every command 3x.. and it finally worked when i did an apt update and it gave warnings on how unifi package has been configured multiple times…
Main error preventing me was Signatures could not be verified as public key is not available. Request issues/else? Or does it override after so many attempts to NOKEY?
Hi.
After running through the guide, I’m almost happy.
Things seem to be fine on the Raspberry, but it doens’t answer at port 8443.
How can I verify the installation?
What can be wrong?
I hope you can help me.
Hi Søren,
Did you try HTTP and HTTPS?
I think it’s https by default
sudo service unifi status is running ?
I use the adress https://192.168.1.15:8443. I looks like the port 8443 is blocked on the respberry. Is there a way to open that port?
How do I make the sudo service running?
Sorry, I’m very new to the Raspberry.
The service will open the port on start
sudo service unifi statussudo service unifi start
sudo service unifi stop
If it doesn’t work, you can check the logs to find the error (/var/log/syslog for example)
Hello everyone,
For information, I just updated this post
The installation and the welcome wizard was a bit different, so this is now up to date
I couldn’t update the screenshots on the access point adoption process due to the current lockdown. But it should be almost the same
Let me know if you have any issues
Thank you for the article. It was most helpful. The only problem I ran into was access the URL for the controller. IE, Edge, Chrome, Brave all indicated this error: ERR_SSL_VERSION_OR_CIPHER_MISMATCH. Being I had not restarted the RPi after all the steps, I decided to reboot and the problem went away. 🙂 Really great site you have!
Thanks for your feedback Chris!
Great article, thanks!
So quick question. I followed this and have everything working but there is an update to 5.14. I keep getting a message stating
E: Repository ‘https://dl.ubnt.com/unifi/debian stable InRelease’ changed its ‘Codename’ value from ‘unifi-5.13’ to ‘unifi-5.14’
N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.
How can I fix this?
Hi Barry,
Try this:
If it’s not enough, apt-get dist-upgrade can also do the job
Let me know
Hi, thanks for the article. How can I go about downgrading to 5.x.x as I’m currently on 6.0.23 and I think it’s causing me issues.
Hi,
You can’t downgrade.
But you can uninstall it, reinstall the old version and import and old backup made with the same version.
If you don’t have the backup it’s not possible (or at least you start from scratch and need to reset the APs).