Start with a full stack app with user accounts, deploy it to the cloud, then add websockets. After that come back and ask again for next steps.
I don't know how to create server instances on the fly.
You'll want to be cautious of, and thoughtful in, your security because you are allowing users to run untrusted code. It's not just about protecting yourself from them, but also protecting users from each other.