This video and his github code examples for the two files were perfect to help me migrate to the newest docker version to host my unifi controller. One thing important is that in my case, I migrated to a new IP address. After migrating, I was stuck in adoption mode for the APs and switches. I was able to fix this by selecting the legacy UI, navigating to Settings, Network Application, Network Application Hostname/IP and then changing that to the new IP address. After that the adoption took place and I'm fully up and running. Thank you for this.
Finally migrated from CloudKey gen 1 to Docker on Linux. Your configuration files really helped me with the database integration. Thanks. I especially appreciate your calm and clear voice.
Many thanks for your detailed explanation! I used linuxserver/unifi-controller in the past, but switched to jacobalberty/unifi when linuxserver separated MongoDB into an external dependency. jacobalberty/unifi has served me well, but it seems that it's updated a lot less frequently than linuxserver. I started reading linuxserver documentation to prepare for migrating back. This video answered all of my remaining questions. I feel much more prepared to jump back (to get a more up-to-date controller)!
@@Jims-Garage Eeeek, I'm getting this error on an AMD quad core with 16GB RAM "There is insufficient memory for the Java Runtime Environment to continue."
Great video... I use newer docker compose version (3.x instead of 2.x), and unifi controller utilizes the "depends_on: unifi-mongo" command so the startup order is correct
Thanks a lot for this video! Worked well. I used '8' for the Mongo tag since 4 seemed a bit outdated at this point. I had no idea my controller was so out of date, ultimately ended up here because I couldn't adopt the new 2.5G Flex Mini!
Thanx mate! Worked like like a charm from 7.x with internal "db" to 8.x w external mongo db , for my install I removed the networks and labels stuff from Your composer file (since i do not use it) - and 1 2 3 restore backup and it was up n running! Great video got rid of all my config/install questions and made it all so much simpler.
Thank you Jim! Really appreciate this video with the instructions making it available with Traefik. Just found your channel a few weeks ago and am enjoying everything you’re doing. Thanks for all this great content and explaining it very clearly and easily to follow.
Perfect video as always, thanks Jim. was gonne move my unify controller from my home assistant to its own place in docker so this is perfect timing for me.
Thanks for sharing this great guide! I'm now running this on a raspberry pi 4 and to get it to work i had to use mongo:4.4.18 . Other versions complained about the ARM Architechture.
I would love to see a video on using this with `docker stack deploy`. It's unable to identify the devices initially because it has to use an overlay network, when Im guessing it needs an IP on the physical network. Haven't found a solution to this issue yet, but I'm firm on hosting it within a swarm for high availability so I continue to dig.
Hi Jim. I am interested in using the UniFi cameras on my network. I remember hearing that the cameras run on UniFi Protect. I'm not sure if this is separate from UniFi Network. Would this docker container support the cameras as well?
Unfortunately unifi protect requires ubiqiti hardware, you cannot run it with the docker image. I use unifi cameras with frigate, in my opinion it's better than protect, I have a video on it.
okay im glad i watched this ill update this sooner rather than later i do have a few questions i have the linux server hosting docker on a different vlan that thw switch is you mentioned about this in the video what i had to do is setinform manually by running the command i do just want to eliminate that but i cant get myself to put the server on a physical network here is my question what rules do you use to have seem-less adoption
Been looking for a good Unifi container vid. This looks good. I run the Unifi network application on a separate Linux box right now (not in a container). Been running for months with no problems. I’ve installed docker on another Linux machine and created the containers like in your vid. I run the up command. Everything looks good per the logs (via Portainer). I have a basic flat network. The Unifi network app web page comes up (comes up on any PC on the network). I recovered my backup from my working Unifi network app on the separate Linux box. However, the Unifi devices are just grayed out in the Unifi equipment list. Am I getting something wrong in docker networking? Does this have anything to do with the inform address?
Yes, it's because the inform address (IP is different). You need to ssh into each device and change the inform address. It's a single command, very simple (check their site)
Thanks Jim for the great video!! Just wondering have you configured the backup configuration post migration ? It seems moved to unifi mongo docker not able to create the auto backup. I am getting db error. Would you able to validate that it’s working ? Thanks
Another great vidoe, JIm! Unfortunately I do not get it to work in Docker Swarm yet. Is there anything I still need to change (except the overlay network(s))?
Where in unifis documentation does it say the regular self hosted controller is deprecated? I want to update my self hosted controller to version 8, if possible.
It isn't unifi's that deprecated, it's Linux IO's container that is, it's the most popular from my experience. If you're using some other image you are likely fine.
Thanks for the video Jim, After completing the installation and restoring from a backup that I made from my cloud key, I am brought to the login screen however NONE of my logins work. I'm quite baffled by this. I'm still able to login to the cloud key that the backup was made from. I've tried "root", "admin", "ubnt" and anything else I can think of but I just can't login at all. Any ideas to help me out? Would be greatly appreciated!
i get an "Error: EACCES: permission denied, open '/docker-entrypoint-initdb.d/init-mongo.js'" what can i do? the file location is correct and its correctly mounted. How can i grant access to the file? My NAS is on Ubuntu OS (UGOS)
@@Jims-Garage You mean, I have to change on docker-compose.yml (instead of latest, I put a new version like 8.5.6) ? stop the container, than docker compose up -d or how can I do it right, for update / upgrade ?
So if I don't use proxy, I skip line 46, 60 and 61? And If I go with NGINX in the future I need to either add them again, or do something else? And thanks for the video!!
Without a proxy ignore the Traefik labels (and probably the network proxy). If you use Nginx you'll need to follow their instructions for forwarding (I may cover this in future)
can you say, why devices status on unifi controller are offline? i have restore file from backup. but it isnt work. alle device are offline... who can i fix this? thanks.
that 's mean, i have to reset all the device? (before I have another IP. Now, I install sophos xg home. than new VM has new IP on Portaine/Traefik etc. Than, I install unifi contoller like you. The nw VM has new IP. And on backup file is als IP. That's why, all device are offline. now, I have to reset all? right@@Jims-Garage
No, you don't need one, strip the labels out if you're not using Traefik. The benefits are proper SSL certificates (albeit it's more of a nice to have than a must have for internal access). I'm not sure off hand how to use Nginx proxy manager. It might be worth using something else in lieu of all their security issues (e.g., nginx or Traefik)
@@Jims-Garage Thank you very much for your time to explain my beginner's question. Much appreciate it a lot. Please keep up your awesome job. Btw, I learned a lot watching you videos. Such a great value
Any suggestions on why I get "***aborting after fassert() failure" in my logfiles. It only cycles through the same lines ending with "***aborting after fassert() failure". I hame my data folder mounted on a NAS using CIFS shares. When I inspect the unifi controller container it's waiting for MongoDB do be reachable.
"If you're considering installing it on a Raspberry Pi 4, I advise against it. The Raspberry Pi 4 uses an ARM8 processor, and unfortunately, MongoDB no longer supports this architecture as of version 4.4. Additionally, there are persistent issues when running UniFi on Docker. Devices frequently switch between offline and online states, and there are constant problems with adapting and readapting. Sometimes, it's impossible to adapt them at all, even if you've set the correct controller address in Settings > Advanced - Overide. I've also experienced data loss on my SD card three times and once on my HDD. The last time, I couldn't even restore from a backup. Devices wouldn't adapt, even through SSH. Those that I did manage to restore ended up malfunctioning soon after. Eventually, I opted to purchase a dedicated controller, and I haven't had any issues since then."
Had a similar issue with running MongoDB on Raspberry PI4. However I noticed that by being more specific about the Mongodb version, I got it to work. I.s.o pointing out version 4.4 I used the latest version that supports ARM8 (and not the later ARM8V2) which is 4.4.18. That did it for me.
@khanhthedag7269 vor 0 Sekunden that 's mean, i have to reset all the device? (before I have another IP. Now, I install sophos xg home. than new VM has new IP on Portaine/Traefik etc. Than, I install unifi contoller like you. The nw VM has new IP. And on backup file is als IP. That's why, all device are offline. now, I have to reset all? right?
I have also try. not working. another thing. the port 8080:8080 is use by traefik. i try to change 8181:8181 on unifi docker.compose file. also not working. what wrong here?@@Jims-Garage
I have also try with https. Not Working. another thing. 8080:8080 is busy, used by traefik. I have change on docker-compose on unifi (8181:8080). Not working. how can I fix this, for working...?@@Jims-Garage
Hi Jim, delete all and try again. I know why it not working. I have make first Traefik Crawdsec (change traefik.yml, than Traefik secure (change again traefikl.yml) and finally setup unifi controller. now it work. Thank you.@@Jims-Garage
Awsome, but I get this error message:WARNING: MongoDB requires ARMv8.2-A or higher, and your current system does not appear to implement any of the common features for that! applies to all versions ≥5.0, any of 4.4 ≥4.4.19 Im runing ubuntu on a raspberry pi 4, maybe that doesnt work?
@@Jims-Garage Thanks... Well then my apologies for suggesting you did.. Must have been something at my end then.... soz... I had quiet a few issues getting this to work... Currently I'm not using a reverse proxy yet.... Installing the controller was easy.. Having it find my unifi switch was a different story... Ended up having to create a macvlan with the subnet my switch resides in.. Opening some ports on my opnsense firewall and it worked.. Cheers! Love your videos, detailed and interesting to follow...
Thanks again James,
Seamless migration to new docker (now with Traefik) and successfully restored backup from old Docker. 👍
Excellent, good job 👍
This video and his github code examples for the two files were perfect to help me migrate to the newest docker version to host my unifi controller. One thing important is that in my case, I migrated to a new IP address. After migrating, I was stuck in adoption mode for the APs and switches. I was able to fix this by selecting the legacy UI, navigating to Settings, Network Application, Network Application Hostname/IP and then changing that to the new IP address. After that the adoption took place and I'm fully up and running. Thank you for this.
You're most welcome, I'm glad it worked out.
Very straightforward and to the point. Having the files available on GitHub is a bonus. I was up and running in short order. Thank you!
Glad it helped!
Finally migrated from CloudKey gen 1 to Docker on Linux. Your configuration files really helped me with the database integration. Thanks. I especially appreciate your calm and clear voice.
Thanks, glad it worked for you. Appreciate the feedback
Many thanks for your detailed explanation! I used linuxserver/unifi-controller in the past, but switched to jacobalberty/unifi when linuxserver separated MongoDB into an external dependency. jacobalberty/unifi has served me well, but it seems that it's updated a lot less frequently than linuxserver. I started reading linuxserver documentation to prepare for migrating back. This video answered all of my remaining questions. I feel much more prepared to jump back (to get a more up-to-date controller)!
You're welcome, good luck 🤞
Absolutely superb video. I’m just about to jump from Unifi 7 to 8 with external MongoDB and this is so useful, many thanks!
No problem, you're welcome. Thanks for commenting.
@@Jims-Garage Eeeek, I'm getting this error on an AMD quad core with 16GB RAM "There is insufficient memory for the Java Runtime Environment to continue."
Great video... I use newer docker compose version (3.x instead of 2.x), and unifi controller utilizes the "depends_on: unifi-mongo" command so the startup order is correct
Yes, that's a good idea. I should add that.
Thanks a lot for this video! Worked well. I used '8' for the Mongo tag since 4 seemed a bit outdated at this point. I had no idea my controller was so out of date, ultimately ended up here because I couldn't adopt the new 2.5G Flex Mini!
@@stokley121 ace, glad it still works well.
Thanx mate! Worked like like a charm from 7.x with internal "db" to 8.x w external mongo db , for my install I removed the networks and labels stuff from Your composer file (since i do not use it) - and 1 2 3 restore backup and it was up n running! Great video got rid of all my config/install questions and made it all so much simpler.
Glad it helped, thanks for dropping a comment
Thank you Jim! Really appreciate this video with the instructions making it available with Traefik. Just found your channel a few weeks ago and am enjoying everything you’re doing. Thanks for all this great content and explaining it very clearly and easily to follow.
Glad it was useful, thanks for the feedback.
Perfect video as always, thanks Jim. was gonne move my unify controller from my home assistant to its own place in docker so this is perfect timing for me.
Glad it's helpful
Great content as always, and even better timing, to migrate our old containers!
Thanks for the feedback
Thanks for sharing this great guide! I'm now running this on a raspberry pi 4 and to get it to work i had to use mongo:4.4.18 . Other versions complained about the ARM Architechture.
Glad it helped!
Thank you James, greate again fully detailed tutorial, specially Docker configed with Traefik. 👌 👍
You're welcome
This tutorial was wonderful…moved my instance off my rpi onto a unbuntu server running docker nice and easy! Thanks
Glad it worked 😁
Nice video, thank you for showing how to make it work with reverse proxy as I did not figure that one on my own.
No worries, you're welcome
Thanks Jim for your videos. I'm just getting in homelabing and wanting to learn proxmox, truenas, Kubernetics, and all that jazz. Keep it up ❤
Awesome, welcome to the hobby!
Great video, thanks!
Thanks!
Just what I was looking for! thanks
Awesome 😎
LIFESAVER! Btw for old server peeps like myself, use Mongo version 4.4
@@greensheen8759 you're welcome 😁
This was so helpful, thanks a lot.
Glad it was helpful!
I would love to see a video on using this with `docker stack deploy`. It's unable to identify the devices initially because it has to use an overlay network, when Im guessing it needs an IP on the physical network. Haven't found a solution to this issue yet, but I'm firm on hosting it within a swarm for high availability so I continue to dig.
Interesting, I'm running this on Kubernetes without issue. I had problems with overlay networks on KVM images.
Just an FYI as your video pulled down Unifi Network Application 8.0.26 as latest. MongoDB 3.6 through 7 is supported as of UNA version 8.1
@@jerescha thanks 👍
I love how EVERY transition is a twirl. You deserve your creative license there - because the quality is A+++. lol
Whups - there are some flip transitions too.
I didnt realize you can use unifi access points with other hardware. I bought udm pro se for all this. But I am pretty happy with udm pro se.
Great, it's a cool device, I just wish it had HA.
Hi Jim. I am interested in using the UniFi cameras on my network. I remember hearing that the cameras run on UniFi Protect. I'm not sure if this is separate from UniFi Network. Would this docker container support the cameras as well?
Unfortunately unifi protect requires ubiqiti hardware, you cannot run it with the docker image. I use unifi cameras with frigate, in my opinion it's better than protect, I have a video on it.
okay im glad i watched this
ill update this sooner rather than later
i do have a few questions
i have the linux server hosting docker on a different vlan that thw switch is
you mentioned about this in the video
what i had to do is setinform manually by running the command i do just want to eliminate that but i cant get myself to put the server on a physical network
here is my question
what rules do you use to have seem-less adoption
Essentially you need a rule that allows traffic from the physical device network to the management vLAN on the ports in the docker compose file.
at 11:30 the version you were signing into was 8.0.26, but the dashboard at 11:40 was 8.0.24. ?¿
Good spot. Possibly a caching issue
Been looking for a good Unifi container vid. This looks good.
I run the Unifi network application on a separate Linux box right now (not in a container). Been running for months with no problems.
I’ve installed docker on another Linux machine and created the containers like in your vid.
I run the up command. Everything looks good per the logs (via Portainer).
I have a basic flat network. The Unifi network app web page comes up (comes up on any PC on the network). I recovered my backup from my working Unifi network app on the separate Linux box.
However, the Unifi devices are just grayed out in the Unifi equipment list.
Am I getting something wrong in docker networking?
Does this have anything to do with the inform address?
Yes, it's because the inform address (IP is different). You need to ssh into each device and change the inform address. It's a single command, very simple (check their site)
That did the trick!
Did the ssh to all my devices and “Bob’s your uncle”.
(assuming you're a Brit).
@@rrr92462 Sally's yer Aunt. I believe you can also use a DNS hostname in case you ever alter the IP in the future.
Thanks Jim for the great video!! Just wondering have you configured the backup configuration post migration ? It seems moved to unifi mongo docker not able to create the auto backup. I am getting db error. Would you able to validate that it’s working ? Thanks
Another great vidoe, JIm! Unfortunately I do not get it to work in Docker Swarm yet. Is there anything I still need to change (except the overlay network(s))?
I'll have to check out swarm. Make sure you don't use the KVM image as that doesn't play nicely with network overlay.
Where in unifis documentation does it say the regular self hosted controller is deprecated? I want to update my self hosted controller to version 8, if possible.
It isn't unifi's that deprecated, it's Linux IO's container that is, it's the most popular from my experience. If you're using some other image you are likely fine.
Thanks for the video Jim,
After completing the installation and restoring from a backup that I made from my cloud key, I am brought to the login screen however NONE of my logins work. I'm quite baffled by this. I'm still able to login to the cloud key that the backup was made from. I've tried "root", "admin", "ubnt" and anything else I can think of but I just can't login at all.
Any ideas to help me out? Would be greatly appreciated!
Interesting, are there any errors in the logs? Is the database connection OK? I assume it's a local account in UI?
i get an "Error: EACCES: permission denied, open '/docker-entrypoint-initdb.d/init-mongo.js'" what can i do? the file location is correct and its correctly mounted. How can i grant access to the file?
My NAS is on Ubuntu OS (UGOS)
Hi Jims,
I have a quetion, about update unifi controller application. how can i do this?
Shutdown the container, do a docker pull to the image you want, and restart it.
@@Jims-Garage You mean, I have to change on docker-compose.yml (instead of latest, I put a new version like 8.5.6) ?
stop the container, than docker compose up -d
or how can I do it right, for update / upgrade ?
So if I don't use proxy, I skip line 46, 60 and 61?
And If I go with NGINX in the future I need to either add them again, or do something else?
And thanks for the video!!
Without a proxy ignore the Traefik labels (and probably the network proxy). If you use Nginx you'll need to follow their instructions for forwarding (I may cover this in future)
@@Jims-Garage thanks
@@Jims-Garage I'd like to see some Nginx related video's if possible.
@@try-that sure, I can do that
can you say, why devices status on unifi controller are offline?
i have restore file from backup. but it isnt work. alle device are offline...
who can i fix this? thanks.
You likely need to inform the devices to use the docker IP
that 's mean, i have to reset all the device?
(before I have another IP. Now, I install sophos xg home. than new VM has new IP on Portaine/Traefik etc. Than, I install unifi contoller like you. The nw VM has new IP. And on backup file is als IP.
That's why, all device are offline.
now, I have to reset all? right@@Jims-Garage
Can't seem to get this working as non-root, any suggestions?
Do I need a reverse proxy? what is the benefit of using it? I'm running nginx proxy manager. how do I config this?
No, you don't need one, strip the labels out if you're not using Traefik. The benefits are proper SSL certificates (albeit it's more of a nice to have than a must have for internal access).
I'm not sure off hand how to use Nginx proxy manager. It might be worth using something else in lieu of all their security issues (e.g., nginx or Traefik)
@@Jims-Garage Thank you very much for your time to explain my beginner's question. Much appreciate it a lot. Please keep up your awesome job.
Btw, I learned a lot watching you videos. Such a great value
@@SE-161 that's great to hear, I appreciate your feedback
Any suggestions on why I get "***aborting after fassert() failure" in my logfiles. It only cycles through the same lines ending with "***aborting after fassert() failure". I hame my data folder mounted on a NAS using CIFS shares. When I inspect the unifi controller container it's waiting for MongoDB do be reachable.
Well, thats unfortunate, MongoDB dosen't like writing to CIFS shares.
Now what about updates?? How do you update through Docker??
The same way you update any container. Bring it down, edit the compose, redeploy.
@@Jims-Garage what should be edited in compose?
"If you're considering installing it on a Raspberry Pi 4, I advise against it. The Raspberry Pi 4 uses an ARM8 processor, and unfortunately, MongoDB no longer supports this architecture as of version 4.4. Additionally, there are persistent issues when running UniFi on Docker. Devices frequently switch between offline and online states, and there are constant problems with adapting and readapting. Sometimes, it's impossible to adapt them at all, even if you've set the correct controller address in Settings > Advanced - Overide. I've also experienced data loss on my SD card three times and once on my HDD. The last time, I couldn't even restore from a backup. Devices wouldn't adapt, even through SSH. Those that I did manage to restore ended up malfunctioning soon after. Eventually, I opted to purchase a dedicated controller, and I haven't had any issues since then."
Had a similar issue with running MongoDB on Raspberry PI4. However I noticed that by being more specific about the Mongodb version, I got it to work. I.s.o pointing out version 4.4 I used the latest version that supports ARM8 (and not the later ARM8V2) which is 4.4.18. That did it for me.
Does any one also run into the problem that login is not possible after restoring?
Seems to be a common issue…
@khanhthedag7269
vor 0 Sekunden
that 's mean, i have to reset all the device?
(before I have another IP. Now, I install sophos xg home. than new VM has new IP on Portaine/Traefik etc. Than, I install unifi contoller like you. The nw VM has new IP. And on backup file is als IP.
That's why, all device are offline.
now, I have to reset all? right?
Login to each device, and set the inform IP to the new controller. Should pick right back up.
how can I do this? and where can I do, on terminal or on on unifi-contoller ui?@@Jims-Garage
Thanks for Tutorial.
I have install. If I call the domain (or IP:8443), it show this. HTTP Status 404 - Not Found
why? Can you help me.
Try with https.
I have also try. not working. another thing. the port 8080:8080 is use by traefik.
i try to change 8181:8181 on unifi docker.compose file. also not working. what wrong here?@@Jims-Garage
I have also try with https. Not Working. another thing. 8080:8080 is busy, used by traefik.
I have change on docker-compose on unifi (8181:8080). Not working.
how can I fix this, for working...?@@Jims-Garage
Hi Jim, delete all and try again. I know why it not working.
I have make first Traefik Crawdsec (change traefik.yml, than Traefik secure (change again traefikl.yml) and finally setup unifi controller.
now it work. Thank you.@@Jims-Garage
Awsome, but I get this error message:WARNING: MongoDB requires ARMv8.2-A or higher, and your current system does not appear to implement any of the common features for that!
applies to all versions ≥5.0, any of 4.4 ≥4.4.19
Im runing ubuntu on a raspberry pi 4, maybe that doesnt work?
@@henrikolausson7714 it'll be something ARM specific. I think the pi 4 is arm v7 but I might be wrong
without mongodb?
To my knowledge there is no longer a docker image without MongoDB that is supported. You can run the unifi controller script made by Glenn in a VM.
4 videos in a week? Jim you don’t need to go this hard. Calm down 😅
I have about 80 videos I want to do before I can rest (before they're outdated ha)
@@Jims-GarageI love it. I’m learning a ton.
@@thespencerowen thanks, that's how I'm treating it. It's fun to make and as long as people find them useful I'll continue.
Understood like 1% of this. Doesn't look like I'm gonna be using docker, way too complicated
I do have Docker beginner videos earlier on. Containers are well worth learning if of interest to you.
@@Jims-Garage I’ll check it out, but I’ll probably just hire somebody to walk me through setup
did you actually delete my post? sjeez
Nope, I never delete posts. I'll check and approve (typically links get auto deleted)
@@Jims-Garage Thanks... Well then my apologies for suggesting you did.. Must have been something at my end then.... soz...
I had quiet a few issues getting this to work... Currently I'm not using a reverse proxy yet.... Installing the controller was easy.. Having it find my unifi switch was a different story... Ended up having to create a macvlan with the subnet my switch resides in.. Opening some ports on my opnsense firewall and it worked..
Cheers!
Love your videos, detailed and interesting to follow...
@@JPEaglesandKatz
glad it worked, that's how I did mine :)
Super helpful! Thank you so much for sharing!
You're welcome 🤗