How to start Jenkins on different port in Windows 10


Jenkins, open source continuous integration server runs on 8080 HTTP port by default.

There is a scenario where we may other service running on the same port usually Tomcat and in such case when we try to start Jenkins, we get Bind Exception.

How to change the port when Jenkins is installed in Windows 10 using Jenkins.exe specifically created for Windows OS distribution?

Go to JENKINS_HOME directory. Normally it is available in the C:\Program Files (x86)\Jenkins when installed using Windows Installation Package.

Find jenkins.xml file and open it in edit mode.

JENKINS_HOME in Windows 10

Locate arguments tag.

Change the value for –httpPort from 8080 to another port number.

<service>
<id>Jenkins</id>
<name>Jenkins</name>
<description>This service runs Jenkins continuous integration system.</description>
<env name=”JENKINS_HOME” value=”%BASE%”/>
<!–
if you’d like to run Jenkins with a specific version of Java, specify a full path to java.exe.
The following value assumes that you have java in your PATH.
–>
<executable>%BASE%\jre\bin\java</executable>
<arguments>-Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar “%BASE%\jenkins.war” –httpPort=8080 –webroot=”%BASE%\war”</arguments>
<!–
interactive flag causes the empty black Java window to be displayed.
I’m still debugging this.
<interactive />
–>
<logmode>rotate</logmode>

<onfailure action=”restart” />
</service>

Restart the Service!

Restart Jenkins Sevice

 

Use the new port number in the Jenkins URL.

Leave a comment

Your email address will not be published. Required fields are marked *