MIAB is very much stand-alone and self-contained. I think the short answer is “you don’t”
Of course, anything is possible with enough of your effort, but you’d be deviating from MIAB and on your own. MIAB overwrites lots of stuff during updates, so deviations from the standard install often get clobbered and can get be troublesome. @alento might know more about nextcloud and be able to assist.
Perhaps another approach would be to move your existing Nextcloud users onto a fresh MIAB. I think MIAB installs & uses only portion of nextcloud, so the practicality of this approach will depend on how much of nextcloud you use, and how customised it is.
FWIW I had a go at this, concern was that NextCloud in MIAB lags the current release. I ran two VMs, generic MIAB (background) on one and the latest NextCloud (Docker AIO) with Caddy proxy (foreground,accessible on the internet) on the 2nd . I used the NextCloud app “Snapmail” (connected back to MIAB using imap) as my mail client.
My issue was both Caddy and MIAB automatically generated LetsEncrypt certs so they needed seperate public IP addresses. On my setup MIAB would fail to renew certs because port forwading goes to Caddy. , I had to switch the port forwarding into MIAB, renew MIAB certs then put it back to Caddy. I run MIAB from home so only have 1 IP available.
So I figured had the best of both: MIAB had minimal exposure to internet (SMTP only), no changes to MIAB required, MFA on my email/NextCloud and the full NextCloud suite (latest Dockerised version).
The port forwarding was a pain so I have gone back to just MIAB standalone. I use NextCloud a lot more nowadays (very useful when travelling internationally)
I’ve been using miab for a few months now, migrated from a roll your own postfix / dovecot / z-push / nextcloud that I’ve been using for years.
I only really use the files function in nextcloud with group folders for our family, but it’s really useful.
I’ve just unlocked the nextcloud that’s embedded in miab and it’s working perfectly for me. I followed the instructions at RainLoop in Nextcloud (MIAB v0.26+ ONLY).