Nextcloud uses AGPL. But because of use of Nextcloud GmbH infrastructure e.g. push services and Nextcloud AppStore there are restrictions because of number of users.
Normal Nextcloud
https://nextcloud.com/fairusepolicy
The user limit seems to be 500. But years ago i found in the source code 1000.
Nextcloud AIO
https://nextcloud.com/all-in-one
Here the limit seems to be <100.
If you have more users, there will be restrictions and above all a really ugly presented message on the login page, see e.g. https://nc.nl.tab.digital. As it is AGPL, you can of course change the message in the source code.