This post was inspired by a post in a Ubiquiti forum on FaceBook about whether you should have a single cloud hosted controller or a Cloud Key per site. I use one per site as it gives me a lot of flexibility, allows the client to move on if they no longer use my services and can be upgraded independently of other sites.

However one guy chimed in and said ‘I’ve got a bunch of CK v1 that go down all the time and require an onsite to reload them form scratch. I made a couple of suggestions, hence the reason for this post. Here’ is the full version of how to deal with these things- they can get cranky occasionally!

  1. When you set one up for the first time, always take a backup and download it before you leave the site
  2. Always set the logs and backups so that they won’t fill up the SD card
  3. SD cards use wear levelling to last longer- use a bigger card to have less issues with the card wearing out
  4. If replacing the SD card don’t use a crappy brand, had loads of issues with the supplied Kingston ones, Samsung no issues ever
  5. Power issues will corrupt the built in MongoDB database, and sometimes it won’t recover. It’s a 32 bit only install so you can’t use any modern tricks to keep it pristine. I haven’t tried turning on journalling, let me know if this works
  6. I will often run the Cloud Key v1 from a POE port on a switch, and additionally run a USB cable from the port on a USG-Pro-4 to the power port on the Cloud Key. This means that rebooting the POE switch or the USG won’t affect the cloud Key’s access to power. Worth it for <$5
  7. If the worst happens and the Cloud key does go down, read on!

Straight after this conversation I started to have troubles with one of Cloud Keys, so I’ve been going through the tips online.

First, check the database using this article –
https://help.ubnt.com/hc/en-us/articles/360006634094-UniFi-Network-Controller-Repairing-Database-Issues-on-the-UniFi-Controller

This didn’t fix mine, so going down the rabbit hole even further I found this-
https://help.ubnt.com/hc/en-us/articles/360000128688-UniFi-Troubleshooting-Offline-Cloud-Key-and-Other-Stability-Issues

Then of course if things have really gone Pete Tong, you may need to recover the device using the emergency GUI-

https://help.ubnt.com/hc/en-us/articles/220334168-UniFi-Cloud-Key-Emergency-Recovery-UI

Supplemental- this article shows how to upgrade the Cloud key via SSH
https://help.ubnt.com/hc/en-us/articles/216655518

Interestingly my Cloud Key appears to have had an issue with an update. I downloaded a backup before doing the update (lucky!) and had issues since. So the way I had to fix it was this-

  1. SSH / SFTP in to Cloud Key
  2. Download all the backups
  3. Reset the Cloud Key to factory defaults
  4. This restored controller software 5.11.50 but my backup was from 5.12.35 so it would not restore
  5. Had to set up the Cloud Key as a new install, then upgrade the controller software
  6. (You could probably just log into the ‘Admin Cloud Key’ and upgrade it in ‘Maintenance’ tab)
  7. Then restore the backup in the setup interface-
  8. manually set the restore file if it doesn’t see the ones on it’s internal card
  9. All good!

I nearly needed new underpants when the factory reset showed me there were no backups! Hint to UBNT- how about showing the backups (they did exist!) and tell the user that you can’t restore them until you upgrade the Controller software. This could save many people’s sanity…