When you start Node-RED you can use the command-line arguments to point at a different settings file and userDirectory for each instance. Each setting file can specify a different port and flow file name.
https://nodered.org/docs/getting-started/running#command-line-usage