Using different ports for Jenkins
By default, Jenkins runs on port number 8080
.
Getting ready
There are scenarios where Tomcat is running on 8080
, or any other application is running on 8080
port. In such cases, to avoid port conflicts you need to change the port.
How to do it...
Let's change a port on which Jenkins runs:
- If you run Jenkins using the command line, then you can execute a command such as
java -jar -httpPort=9999 jenkins.war
to change the existing port from8080
to9999
. - Another way to change the port while Jenkins is installed using the Windows package is as follows:
- Go to the
Program Files/Jenkins
directory where you installed Jenkins - Open the
Jenkins.xml
in the editor - Find "
--httpPort=8080
" and replace the port8080
with the new port number
- Go to the
How it works...
First, you installed a virtual image of Ubuntu, changed the password so that it is harder for others to log in, and updated the guest OS for security patches.