Moving the Wi-Fi controller to UniFi OS Server
Our three UniFi access points are managed by a controller running in a VM. Until 2026-11-15 that was the standalone UniFi Network Application (version 10.6), in a container. It worked, but I wanted the agent to be able to manage the Wi-Fi through an API, and the standalone application doesn’t do API keys. There’s no menu for them, and the agent only found that out for certain by searching the web interface’s own JavaScript bundles instead of the menus. API keys are a UniFi OS feature. So the controller moved to UniFi OS Server, on a new VM, on the afternoon of the same day as the VLAN cutover, as it happens.
Most of it went smoothly, with a few quirks along the way. The OS Server installer ships an older Network application (10.5) than the one our backup came from (10.6), so the application had to be updated before the restore. The agent then restored the backup without the web interface, through two endpoints it found by reading the Network UI’s JavaScript: one to upload the backup, one to restore it. Logging in to UniFi OS repeatedly in a loop, while waiting for things to come up, earned an HTTP 429 (too many requests). Log in once; use the API key wherever it works, which includes the classic Network API under a proxy path.
The new VM took over the old controller’s MAC and IP address, so the access points would find it where they expected. That broke the new VM’s network: cloud-init had written a network file that matches the interface by MAC address, and the MAC had just changed. The agent fixed it with the VM shut down, from the hypervisor, by matching on the interface name instead and switching off cloud-init’s network handling. On the same theme, UniFi OS takes more than two minutes to shut down, and editing a VM’s definition while it’s still running only changes its next boot, so it’s worth waiting for “shut off” before touching anything.
The last one is a small UniFi oddity. Asking for a daily automatic backup was refused with api.err.InvalidAutoBackupDays. It turns out a daily schedule is only accepted with the number of days of data set to zero, which means settings-only backups. That’s what we wanted anyway, but the error message didn’t say so.
All three access points reconnected to the new controller on their own. The old VM is shut off on another hypervisor and kept as a way back, though I haven’t needed it. Restarting the new one takes the controller away for about two and a half minutes; Wi-Fi keeps working the whole time, which is the nice thing about controllers.