jenkinscontinuous-integrationhome-directory

How to change home directory of Jenkins?


Simple question: How to change the jenkins home directory location? By default it points to /var/lib/jenkins whereas I want it to point to /home/jenkins. I have changed my $JENKINS_HOME to /home/jenkins but it doesn't help me.


Solution

  • Jenkins usually runs with its own user,
    so changing the home-dir of that user should do the job.

    If not sure, simply run a test-job with a shell-command like 'id' or 'whoami' or 'env' to find the user that Jenkins uses.

    Also, note that a message of "Started by user anonymous" does not mean that Jenkins started as an anonymous user -
    please see this related answers by Sagar and Peter Tran:

    how to run jenkins as a different user