[jenkins] Where does Jenkins store configuration files for the jobs it runs?

I'm adding continuous integration to an EC2 project at work using Jenkins. The Jenkins machine itself is kept on an EC2 machine - one that might need to be taken offline and brought back on an entirely different EC2 instance at any point. We have a bunch of Puppet manifests allowing us to easily reinstall the software on the EC2 instance, but custom configuration files, like the ones for the jobs I create in Jenkins, would be deleted after the move.

Now, if Jenkins stores what jobs are to be run on it in an XML file or set of XML files somewhere, I could set up a system where those files are committed to the version control server, and then downloaded back to a newly-created server as part of the puppet manifest. Does anyone know where these files are stored? I've tried copying /var/lib/jenkins/jobs, but that appears to store the output of Jenkins' jobs, not the input.

This question is related to jenkins

The answer is


For the sake of completeness: macOS High Sierra, Jenkins 2.x, installation via Homebrew
~/.jenkins/jobs/{project_name}/config.xml

Complete overview about jenkins home: https://wiki.jenkins.io/display/JENKINS/Administering+Jenkins


The best approach would be to keep your job configurations in a Jenkinsfile that live in source control.


On Linux one can find the home directory of Jenkins looking for a file, that Jenkins' home contains, e.g.:

$ find / -name "config.xml" | grep "jenkins"
/var/lib/jenkins/config.xml

Am adding few things related to jenkins configuration files storage.

As per my understanding all config file stores in the machine or OS that you have installed jenkins.

The jobs you are going to create in jenkins will be stored in jenkins server and you can find the config.xml etc., here.

After jenkins installation you will find jenkins workspace in server.

*cd>jenkins/jobs/`
cd>jenkins/jobs/$ls
   job1 job2 job3 config.xml ....*

Jenkins 1.627, OS X 10.10.5 /Users/Shared/Jenkins/Home/jobs/{project_name}/config.xml