Customised Nextcloud as a commercial web app

I have a license-related question. Am I allowed to create a Nexcloud (custom) app, then deploy an instance of Nexcloud with my app to the server, brand / white-label it and commercialize such a system with paid subscriptions?

In other words, I would like to run my app on Nexcloud being the environment, in order to make use of its built-in features like user management, file sharing etc.

What are my options, and how would it affect the source code of my app - would it need to be open-sourced?