Multiple instances in a single server

Hi. I have two instances in a server. As for now, I have two separate folders for each installation, each one with the /versions, /peertube-latest, /config and /node_modules.

I was wondering if it is possible to use a single installation folder and run both instances (each one with its production.yaml config file). That it, using the same /versions, /peertube-latest and /node_modules folder for both instances and then, having a /config_instance1 and a /config_instance2 folder for each production.yaml config file.

That would reduce the effort at update time.

Thanks.

Hello,

Yes, you can. Just use NODE_APP_INSTANCE=1 env variable for instance 1, and NODE_APP_INSTANCE=2 env variable for instance 2. They will use respectively production-1.yaml and production-2.yaml config file.

See also Configurations | PeerTube documentation for more information about the configuration inheritance.

Thanks and sorry for the late response. I tried what you said and it works, but I prefer having each config file in a different folder so I’ve tried by setting NODE_CONFIG_DIR=…/peertube/config_instance_1 and instance_2 and it works as expected.

2 Likes