Thursday, October 9, 2014

Run Jenkins with custom http port or JENKINS HOME

If you need to run Jenkins instance with alternative http port or you want to point custom directory to Jenkins to store job's files then this tip is for you.

To control http port the variable "httpPort" needs to be set. Pointing custom jobs directory can be achieved by setting JENKINS_HOME enviornment variable. This variable needs to be set before "-jar" parameter, so be carefull with order of the parameters.

After downloading jenkins.war from https://wiki.jenkins-ci.org, place it in desired directory, start command line and execute:
a) in Windows
java -DJENKINS_HOME="C:\test\jenkins_home" -jar "C:\test\jenkins.war" --httpPort=8081 
b) in Linux
java -DJENKINS_HOME="/test/jenkins_home" -jar "/test/jenkins.war" --httpPort=8081 

This works with latest Jenkins release and with LTS version as well.

No comments:

Post a Comment

Please be polite in comments.