How to change port for jenkins window service when 8080 is being used
- Go to the directory where you installed Jenkins (by default, it's under Program Files/Jenkins)
- Open the
Jenkins.xml
configuration file - Search
--httpPort=8080
and replace the8080
with the new port number that you wish - Restart Jenkins for changes to take effect
Restart Jenkins service
Just restart the Jenkins service after you changed the port in jenkins.xml.
- Press Win + R
- Type "services.msc"
-
Right click on the "Jenkins" line > Restart
Type
http://localhost:8081/
in your browser to test the change.
On Ubuntu 16.04 LTS you can change the Port like that:
- Change port number in the config file
/etc/default/jenkins
to 8081 (or the port you like)HTTP_PORT=8081
- Restart Jenkins:
service jenkins restart
Start Jenkins from cmd line with this command :
java -jar jenkins.war --httpPort=8081