{"id":2254,"date":"2021-09-04T03:06:28","date_gmt":"2021-09-04T03:06:28","guid":{"rendered":"https:\/\/dft.wiki\/?p=2254"},"modified":"2026-06-08T22:30:44","modified_gmt":"2026-06-09T02:30:44","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>Install 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>Using Chrome (recommended), navigate to the web 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, you can use a Unifi account and expose the controller to the internet to manage multiple sites (useful for managing client infrastructure, for example). For now, skip the login 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 cloud-based features to run the controller in standalone mode, then 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 default 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 on the same network segment, they may be discovered at this step. Either way, 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>Set your Wi-Fi name and 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 your location and timezone. This is important for scheduling firmware upgrades and other time-based features.<\/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>Your dashboard should then look something like this:<\/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 up the system:<\/p>\n<pre>sudo apt clean -y\r\nsudo apt autoremove -y<\/pre>\n<p>Use the following commands to start, restart, or stop the service:<\/p>\n<pre>sudo systemctl start unifi\r\nsudo systemctl restart unifi\r\nsudo systemctl stop unifi<\/pre>\n<p>If you run into issues connecting your controller to the Unifi cloud, run the following commands and try again:<\/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>Allow the required ports 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>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 enabling <strong>Launch using WebRTC<\/strong>. This approach does not require exposing any ports 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 main advantage of running the Unifi Controller in a container is its lightweight footprint. It can run on almost any host in your network, including a Raspberry Pi.<\/p>\n<p>Supported processor architectures:<\/p>\n<ul>\n<li>x86-64\n<ul>\n<li>Standard Intel\/AMD processors.<\/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 Float)\n<ul>\n<li>Raspberry Pi 2 (32-bit).<\/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":12,"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts\/2254\/revisions"}],"predecessor-version":[{"id":5715,"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts\/2254\/revisions\/5715"}],"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}]}}