I've been running nextcloud for some time with this setup:
KVM virtual machine with 4 cores / 8 GiB RAM
docker image: `nextcloud:28.0.2-apache` with db: `mariadb:11.1`
The UI has never been what one would call... "fast". Especially on first load of a page or directory. It's been adequate for me though. Once I click around a bit it caches enough things to feel fairly responsive. I also mount /var/lib/nextcloud off a network share so I'm sure that hits my performance some as well.
Nextcloud leans on the database a lot so be sure to have a local and quick storage for it (no - don't run it on your raspberry pi). There are also cleanup cron jobs and indexes that need to be updated when doing upgrades that help performance as well.