Nextcloud, I can't access it externally

If you used example.com verbatim in your config, that’s one problem. I also don’t see a HTTPS virtual host.

If you’re interested in trying it with Docker, here’s a guide I wrote myself. Or you can use the non-Docker parts for reference.

Although I don’t typically recommend the snap package due to its limitations, it’s arguably the easiest method to set up. With Ubuntu you can even select it during OS installation. Something to consider.