I use this script to install and update UniFi Network [0]. The script is ages old, has been tuned with all kinds of options including acme/letsencrypt, gets updated regularly, very solid. Also installs & upgrades Mongodb.
The self-hosted Unify Network can’t upgrade itself, but it does have a button to verify whether a release is available. I check that option once in a while. When an update is available, I ssh into the VM, execute the latest-release script, answer a few questions and let it do its thing. Done. It even updates the underlying Linux if you wish.
Until bugs in UniFi OS Server get ironed out, this script is highly recommended.
[0] https://community.ui.com/questions/UniFi-Installation-Script...