how to change port number for Jenkins installation In Ubuntu 12.04

93,605

Solution 1

First open the /etc/default/jenkins file.
Then under JENKINS_ARGS section, you can change the port like this HTTP_PORT=9999.

Then you should restart Jenkins with sudo service jenkins restart.

Then to check the status use this command sudo systemctl status jenkins

Solution 2

For others still looking for answers you can go to /etc/sysconfig/jenkins in CentOS/RHEL or /etc/default/jenkins in Debian based distributions and change the JENKINS_PORT= variable to whatever port you want. Restart jenkins, and it should be running on your desired port.

Solution 3

  1. First, run this command to open jenkins configurations:

     sudo nano /etc/default/jenkins
    
  2. The only part you need to change is:

     #port for HTTP connector (default 8080; disable with -1)
     HTTP_PORT = 8080
    

    There you need to change to the desired port. For example:

     HTTP_PORT = 8081
    
  3. Finally, Restart Jenkins service by running this command:

     sudo service jenkins restart
    

Then you're ready to open it with a new port.

Solution 4

In my case,I add

 HTTP_PORT="XXXX"
 JENKINS_ARGS="--httpPort=XXXX" 

when defining the variables at the beginning of /etc/default/jenkins,it works .

Solution 5

step 1 : sudo nano /etc/default/jenkins open the nano file And change HTTP PORT:8080 to HTTP PORT : 8081

CTL+X and Click Y and ENTER

PORT will changing from 8080 to 8081 restart the jenkins

sudo service jenkins restart

Share:
93,605
RCBian
Author by

RCBian

Updated on July 09, 2022

Comments

  • RCBian
    RCBian about 2 years

    I am trying to install jenkins in ubuntu. I have followed the commands below:

    wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | apt-key add -
    
    echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list
    

    then

    apt-get update
    

    and

    apt-get install jenkins
    

    but It shows

    • Starting Jenkins Continuous Integration Server Jenkins The selected http port (8080) seems to be in use by another program Please select another port to use for jenkins

    Need help on how to set a different port for Jenkins to run.

  • Alexandru C.
    Alexandru C. over 9 years
    Try sudo nano /etc/default/jenkins
  • RCBian
    RCBian over 9 years
    i have set port 8081.How to invoke jenkins??
  • Alexandru C.
    Alexandru C. over 9 years
    Just restart the service as specified above and then go in your browser at http://127.0.0.1:8081. The Jenkins page should be there if there were no errors.
  • RCBian
    RCBian over 9 years
    I was able to do with localhost:8081.Thanks
  • BluDragn
    BluDragn over 8 years
    This solution gave me the hint I needed - In my case I was able to edit this file and change the following line: HTTP_PORT=8080 which was referenced already in the JENKINS_ARGS line at the bottom of the file.
  • Dario Seidl
    Dario Seidl almost 8 years
    On Debian-based distros it's still /etc/default/jenkins. It's /etc/sysconfig/jenkins for RHEL/CentOS.
  • d4nyll
    d4nyll over 6 years
    You only need HTTP_PORT, the JENKINS_ARGS is redundant.
  • FlipMcF
    FlipMcF over 6 years
    On Debian-based distros the var is HTTP_PORT now
  • Magnus L
    Magnus L almost 4 years
    @BassemRabia Have you restarted the jenkins service?