How to install Debian 9

First of all have a look into the nextcloud admin manual for installation and security+performance hints. It is not a step by step guide but based on your knowledge it could be enough: https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html#example-installation-on-ubuntu-16-04-lts-server

Jason Bayton also wrote a guide, which is a bid older but still works similar for all debian based systems: https://bayton.org/docs/nextcloud/installing-nextcloud-on-ubuntu-16-04-lts-with-redis-apcu-ssl-apache/

Carsten Rieger wrote a guide providing a bid more advanced installation and configuration: https://www.c-rieger.de/nextcloud-installation-guide/

SyS0p3r provided another guide here that was actually intended for spreed.me webrtc + turn server but provides the whole system + nextcloud installation until that: Complete NC installation on Debian with Spreed.me and TURN step by step

All this guides/manuals are well proven and often used, but some are older or do not 100% fit your Debian 9 wishes.

Alternatively use some plug&play system like nextcloud snap, vm or NextcloudPi.