Handling two local instances of Jenkins

Use a separate folder for the second instance of Jenkins.

Temporarily set the $JENKINS_HOME environment variable to secondary Jenkins home directory, using -D (option to temporarily set an environment variable)

You can specify the directory:

-DJENKINS_HOME='C:\Program Files (x86)\Jenkins\secondInstance'

If you’re running a jar file from inside your second instance’s directory, you could just use ‘.’ to specify the current folder as JENKINS_HOME.

java -DJENKINS_HOME=. -jar jenkins.war

Jenkins will start the new instance and load all jobs and system configurations from here.