You can automatically upgrade your Nextcloud instance from Admin settings. But for whatever reason you are not able to automatically upgrade, you can still manually upgrade Nextcloud.
In this article, we will install Nextcloud 23 on Ubuntu 20.04 with PHP 8. Nextcloud 23 does not recommend to use PHP 7.3 anymore, so it's time to just install PHP 8.