{"id":2254,"date":"2021-09-04T03:06:28","date_gmt":"2021-09-04T03:06:28","guid":{"rendered":"https:\/\/dft.wiki\/?p=2254"},"modified":"2026-04-21T13:32:55","modified_gmt":"2026-04-21T17:32:55","slug":"ubiquiti-unifi-controller-setup-on-ubuntu-20-04","status":"publish","type":"post","link":"https:\/\/dft.wiki\/?p=2254","title":{"rendered":"Ubiquiti Unifi Controller Setup on Ubuntu or Docker"},"content":{"rendered":"<p>Unifi offers a free (but not open-source) controller solution based on Linux with an amazing web GUI and integration with their cloud service [<a href=\"https:\/\/unifi.ui.com\">Link<\/a>].<\/p>\n<p>INSTALLING UNIFI ON UBUNTU 20.04<\/p>\n<pre>sudo apt update\r\nsudo apt install ca-certificates apt-transport-https -y\r\necho 'deb https:\/\/www.ui.com\/downloads\/unifi\/debian stable ubiquiti' | sudo tee \/etc\/apt\/sources.list.d\/100-ubnt-unifi.list\r\nsudo wget -O \/etc\/apt\/trusted.gpg.d\/unifi-repo.gpg https:\/\/dl.ui.com\/unifi\/unifi-repo.gpg<\/pre>\n<p>Installing the controller service:<\/p>\n<pre>sudo apt-get update\r\nsudo apt install openjdk-8-jre-headless unifi -y\r\nsudo systemctl status --no-pager --full mongodb.service unifi.service<\/pre>\n<p>Preferentially using Chrome, navigate to the web user interface at <strong>https:\/\/<span style=\"color: #ff0000;\">10.0.0.1<\/span>:8443\/<\/strong> (replace the <span style=\"color: #ff0000;\"><strong>IP<\/strong><\/span> accordingly).<\/p>\n<p>Follow the 6 steps to create a local account for your private controller.<\/p>\n<p>Give your controller a name and click next.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2363 size-full aligncenter\" src=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/09\/Screenshot_2021-09-03_22-46-52.png\" alt=\"\" width=\"377\" height=\"310\" srcset=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/09\/Screenshot_2021-09-03_22-46-52.png 377w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/09\/Screenshot_2021-09-03_22-46-52-300x247.png 300w\" sizes=\"auto, (max-width: 377px) 100vw, 377px\" \/><\/p>\n<p>Alternatively, an Unifi account could be used and the controller could be exposed to the internet to accept connections from many sites (for managing client&#8217;s infrastructure for example). For now, skip the log on and switch to advanced.<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2364 size-full\" src=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/09\/Screenshot_2021-09-03_22-47-49.png\" alt=\"\" width=\"380\" height=\"366\" srcset=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/09\/Screenshot_2021-09-03_22-47-49.png 380w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/09\/Screenshot_2021-09-03_22-47-49-300x289.png 300w\" sizes=\"auto, (max-width: 380px) 100vw, 380px\" \/><\/p>\n<p>Disable the cloud-based functionalities to make it standalone and create credentials for it.<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2365 size-full\" src=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/09\/Screenshot_2021-09-03_22-48-49.png\" alt=\"\" width=\"382\" height=\"668\" srcset=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/09\/Screenshot_2021-09-03_22-48-49.png 382w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/09\/Screenshot_2021-09-03_22-48-49-172x300.png 172w\" sizes=\"auto, (max-width: 382px) 100vw, 382px\" \/><\/p>\n<p>Leave the defaults options.<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2366 size-full\" src=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/09\/Screenshot_2021-09-03_22-49-10.png\" alt=\"\" width=\"339\" height=\"321\" srcset=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/09\/Screenshot_2021-09-03_22-49-10.png 339w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/09\/Screenshot_2021-09-03_22-49-10-300x284.png 300w\" sizes=\"auto, (max-width: 339px) 100vw, 339px\" \/><\/p>\n<p>If you have Unifi devices in the same network segment they might be discovered in this step. In any case just click next.<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2367 size-full\" src=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/09\/Screenshot_2021-09-03_22-49-33.png\" alt=\"\" width=\"293\" height=\"466\" srcset=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/09\/Screenshot_2021-09-03_22-49-33.png 293w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/09\/Screenshot_2021-09-03_22-49-33-189x300.png 189w\" sizes=\"auto, (max-width: 293px) 100vw, 293px\" \/><\/p>\n<p>Define the name of your WIFI and give it a password.<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2368 size-full\" src=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/09\/Screenshot_2021-09-03_22-50-06.png\" alt=\"\" width=\"379\" height=\"326\" srcset=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/09\/Screenshot_2021-09-03_22-50-06.png 379w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/09\/Screenshot_2021-09-03_22-50-06-300x258.png 300w\" sizes=\"auto, (max-width: 379px) 100vw, 379px\" \/><\/p>\n<p>Set the location and timezone. It is important when you schedule firmware upgrades and other functionalities.<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2369 size-full\" src=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/09\/Screenshot_2021-09-03_22-50-24.png\" alt=\"\" width=\"372\" height=\"317\" srcset=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/09\/Screenshot_2021-09-03_22-50-24.png 372w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/09\/Screenshot_2021-09-03_22-50-24-300x256.png 300w\" sizes=\"auto, (max-width: 372px) 100vw, 372px\" \/><\/p>\n<p>Then your dashboard might look like the following:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2370 size-full aligncenter\" src=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/09\/Screenshot_2021-09-03_22-51-01.png\" alt=\"\" width=\"1699\" height=\"574\" srcset=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/09\/Screenshot_2021-09-03_22-51-01.png 1699w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/09\/Screenshot_2021-09-03_22-51-01-300x101.png 300w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/09\/Screenshot_2021-09-03_22-51-01-1024x346.png 1024w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/09\/Screenshot_2021-09-03_22-51-01-768x259.png 768w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/09\/Screenshot_2021-09-03_22-51-01-1536x519.png 1536w\" sizes=\"auto, (max-width: 1699px) 100vw, 1699px\" \/><\/p>\n<p>Clean the system:<\/p>\n<pre>sudo apt clean -y\r\nsudo apt autoremove -y<\/pre>\n<p>The service can be started and stopped with the following commands:<\/p>\n<pre>sudo systemctl start unifi\r\nsudo systemctl restart unifi\r\nsudo systemctl stop unifi<\/pre>\n<p>In case you ran into issues trying to connect your controller to the Unifi cloud, execute the following commands and try again after:<\/p>\n<pre>sudo systemctl stop unifi\r\nsudo rm \/etc\/ssl\/certs\/java\/cacerts &amp;&gt; \/dev\/null; sudo update-ca-certificates -f\r\nsudo systemctl start unifi<\/pre>\n<p>And allow the used port to be accessible through the firewall:<\/p>\n<pre>sudo ufw allow 8080,8443,8843,8880,6789\/tcp\r\nsudo ufw allow 8080,8443,8843,8880,6789,3478,10001,1900,5514\/udp<\/pre>\n<p>Note the following requirements for cloud access:<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2374 size-full\" src=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/09\/Screenshot_2021-09-03_23-33-19.png\" alt=\"\" width=\"377\" height=\"154\" srcset=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/09\/Screenshot_2021-09-03_23-33-19.png 377w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/09\/Screenshot_2021-09-03_23-33-19-300x123.png 300w\" sizes=\"auto, (max-width: 377px) 100vw, 377px\" \/><\/p>\n<p>Optionally, I recommend changing the <strong>Launch using WebRTC<\/strong>. This way does not require to expose any port to the internet.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-2376 size-full aligncenter\" src=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/09\/Screenshot_2021-09-03_23-36-54.png\" alt=\"\" width=\"380\" height=\"206\" srcset=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/09\/Screenshot_2021-09-03_23-36-54.png 380w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/09\/Screenshot_2021-09-03_23-36-54-300x163.png 300w\" sizes=\"auto, (max-width: 380px) 100vw, 380px\" \/><\/p>\n<hr \/>\n<p>INSTALLING UNIFI ON DOCKER<\/p>\n<p>The best advantage of running the Unifi Controller inside a container is the very lightweight, utilizing the middle resources of any other host in your network and even in a Raspberry Pi.<\/p>\n<p>Supported processor architectures:<\/p>\n<ul>\n<li>x86-64\n<ul>\n<li>Standard Intel\/ADM processores.<\/li>\n<\/ul>\n<\/li>\n<li>ARM64\n<ul>\n<li>Raspberry Pi 3 or newer.<\/li>\n<\/ul>\n<\/li>\n<li>ARMHF (Hard Floating-point)\n<ul>\n<li>Raspberry Pi 2 (32 bits).<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<pre>mkdir ~\/unifi-config\r\nsudo docker run -d --name=unifi -e PUID=1000 -e PGID=1000 -p 3478:3478\/udp -p 10001:10001\/udp -p 8080:8080 -p 8443:8443 -p 1900:1900\/udp -p 8843:8843 -p 8880:8880 -p 6789:6789 -p 5514:5514\/udp -v ~\/unifi-config:\/config --restart unless-stopped ghcr.io\/linuxserver\/unifi-controller<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Unifi offers a free (but not open-source) controller solution based on Linux with an amazing [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,6],"tags":[],"class_list":["post-2254","post","type-post","status-publish","format-standard","hentry","category-linux","category-raspberry-pi"],"_links":{"self":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts\/2254","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2254"}],"version-history":[{"count":11,"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts\/2254\/revisions"}],"predecessor-version":[{"id":5481,"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts\/2254\/revisions\/5481"}],"wp:attachment":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2254"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2254"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2254"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}