Hi @roy-miller there is no specific tutorial for this, but you can install NodeBB as normal on one server, and MongoDB/redis as usual on another server. You can follow the instructions on docs.nodebb.org for your specific OS. The only important part here is ensuring that only your NodeBB app server can communicate with your database server.

How can I install nodebb webserver and database in separate vps for scaling? Please share tutorial?

What do you need to know? It's as easy as installing the database on one VM and the app on another. When you put in the configuration information to the app in config.json it handles everything right there automatically, there is nothing "to know."

Now be aware, unless you are scaling to an absurd degree, this will have a serious negative effect of slowing your site down by adding latency. And I know of no NodeBB site that needs it. What kind of traffic are you expecting? We'd estimate that you'd need over a billion hits a month to even need to talk about something like this, and even then, it would only be "on your radar" and not something that you need.

I would step back and evaluate this carefully. Do you really feel that you are going to run the largest NodeBB installation of all time by orders of magnitude? And if so, maybe you want to bring in specialists who are very used to working with NodeBB and MongoDB and large scale scaling because you are going to need this to really, really work and not just be the first time you are experimenting with setting up something of this nature.

FWIW I use /opt as well for third-party apps. NodeBB, I install in my home directory, but again, it is mostly down to preference.
If you install in /opt, you could always change the ownership of /opt/nodebb to something like nobody:nobody, and ensure it's run unprivileged...