I've heard that a lot of people have trouble with updating and maintaining nextcloud but I personally never had those issues and my instance is running for over 5 years now. I would agree with other people here that something like docker makes everything easier. I personally followed this guide with a custom dockerfile that looks something like this. Once you have a functional docker image and a docker-compose file, updating your instance is as easy as typing:
docker compose stop
docker compose rm -f
docker compose build --pull
docker compose up -d
If you chose to go down that route as well, you might want to change the config files in your docker image since some of the values might not suit your instance. I, for example, have added the following to the PHP config:
RUN sed -i "s/\(opcache\.interned_strings_buffer*=*\).*/\148/" /usr/local/etc/php/conf.d/opcache-recommended.ini
RUN sed -i "s/\(opcache\.memory_consumption*=*\).*/\1256/" /usr/local/etc/php/conf.d/opcache-recommended.ini