Skip to content

Instantly share code, notes, and snippets.

@VikashSaharan1
Last active April 7, 2019 08:43
Show Gist options
  • Save VikashSaharan1/82a804b4eb23083afe6e4d734978d358 to your computer and use it in GitHub Desktop.
Save VikashSaharan1/82a804b4eb23083afe6e4d734978d358 to your computer and use it in GitHub Desktop.
CHANGING PORT for Jenkins

if you want to change default port jenkins mac use these commands :-

$ 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

change port for jenkins window service when 8080 to new port

  1. Go to the directory where you installed the Jenkins (In default, it is under Program Files/Jenkins)
  2. Open the Jenkins.xml
  3. Search --httpPort=8080 and replace the 8080 with the new port number that you wish
  4. Press Win + R
  5. Type "services.msc"
  6. Right click on the "Jenkins" service and click on Restart

Map docker container internal jenkins GUI port 8080 to port 9090 external

docker run -it -d --name jenkins42 --restart always -p :7070:8080

If you are running on Redhat

$ sudo service jenkins stop
$ nano /etc/sysconfig/jenkins
$ find JENKINS_PORT="8080" and change new port JENKINS_PORT="7070"
$ sudo service jenkins start

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment