Use at your own risk. You should test this on an non-productive Test-System to fit your needs
Simply download an run nextcloud-install.sh and run it on you Debian(based) System:
wget https://gitea.ds9.dedyn.io/olli/debian.ansible.nextcloud.server/raw/branch/main/nextcloud-install.sh
1.1. Optional: verify downloaded File with Version on the Server:
cat nextcloud-install.sh
in Terminal.
bash nextcloud-install.sh