$ sudo defaults write /Library/Preferences/org.jenkins-ci httpPort 7070
$ sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist
$ sudo launchctl load /Library/LaunchDaemons/org.jenkins-ci.plist
- Go to the directory where you installed the Jenkins (In default, it is under Program Files/Jenkins)
- Open the Jenkins.xml
- Search --httpPort=8080 and replace the 8080 with the new port number that you wish
- Press Win + R
- Type "services.msc"
- Right click on the "Jenkins" service and click on Restart
docker run -it -d --name jenkins42 --restart always -p :7070:8080
$ sudo service jenkins stop
$ nano /etc/sysconfig/jenkins
$ find JENKINS_PORT="8080" and change new port JENKINS_PORT="7070"
$ sudo service jenkins start