RPI is a popular solution for unifi controller hosting. I’ve run a box with unifi+pihole continuously for about 2 years on PoE, never crashes or gives any maintenance headaches, if I do need to reboot everything always comes right up without any fuss.
Make sure that you're running a 64-bit OS. They use MongoDB for the unifi controller, and it simply disables the write ahead log on 32-bit Linux. This means it'll corrupt itself on crash.