How to start Jenkins on a different port

The jenkins Build and Integration application based on java programming language, tends to have its roots stuck to the typical Tomcat web server
Out of the box the jenkins starts up on the default port 8080 and this can be customized on the system or a new proxy routing can be setup which might add a slight overhead on the jenkins inbound requests,

How to change the Jenkins default Port?

We have the Jenkins default home located at /var/lib/jenkins all the configuration files are present in this location.
The important configuration although is /etc/sysconfig/jenkins which is present outside $JENKINS_HOME
The Jenkins Default JENKINS_PORT parameter is set to 8080

[root@node02 jenkins]# grep JENKINS_PORT /etc/sysconfig/jenkins
JENKINS_PORT="8080"

If you are on Debian or Ubuntu linux, then the relevant file will be /etc/default/jenkins
We will be now changing the variable $JENKINS_HOME to listen to the port 9090 and restarting the jenkins service.

[root@node02 jenkins]# systemctl restart jenkins.service

You can check for the port information from the ps -ef | grep jenkins output as follows or checkout from the netstat command

[root@node02 jenkins]# ps -ef |grep jenkins
jenkins 5110 1 90 23:04 ? 00:00:02 /etc/alternatives/java -Dcom.sun.akuma.Daemon=daemonized -Djava.awt.headless=true -DJENKINS_HOME=/var/lib/jenkins -jar /usr/lib/jenkins/jenkins.war --logfile=/var/log/jenkins/jenkins.log --webroot=/var/cache/jenkins/war --daemon --httpPort=9090 --debug=5 --handlerCountMax=100 --handlerCountMaxIdle=20

How do I change the default Jenkins port in Linux?

  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. …
  3. Finally, Restart Jenkins service by running this command: sudo service jenkins restart.

How do I change my local Jenkins port?

  1. Go to the directory where you installed Jenkins (by default, it’s under Program Files/Jenkins)
  2. Open the Jenkins.xml configuration file.
  3. Search –httpPort=8080 and replace the 8080 with the new port number that you wish.
  4. Restart Jenkins for changes to take effect.

How do I change my Jenkins port from 8080 to 80?

  1. Go to /etc/default folder –> Open the file “jenkins”
  2. Modify the line HTTP_PORT=8080 as HTTP_PORT=80.
  3. Start jenkins as root by using the command: sudo /etc/init.d/jenkins start.
  4. Open a browser and browse as localhost:80.

What port is Jenkins running on?

The default Jenkins installation runs on ports 8080 and 8443. Typically, HTTP/HTTPS servers run on ports 80 and 443, respectively. But these ports are considered privileged on Unix/Linux systems, and the process using them must be owned by root.

How do I start Jenkins on a different port?

How to change the default port in Jenkins

  1. Go to C:\Program Files (x86)\Jenkins (I’m using Windows Server 2012 and assuming it’s installed to default location)
  2. Open Jenkins.xml.
  3. Edit the –httpPort argument (you may need to edit default permissions)
  4. Restart the Jenkins service.
  5. Now Jenkins will permanently use the new port.

How do I run a Jenkins war on another port?

All you need to do:

  1. Goto Jenkins folder present in C:\Program Files (x86)
  2. Open a notepad or text pad and run them as administrator and then try opening the jenkins. xml file present in the jenkins folder.
  3. Change the port number as below: <arguments>-Xrs -Xmx256m -Dhudson. lifecycle=hudson. lifecycle.

How do I change my Jenkins URL?

Fixing a root url

  1. Go to Jenkins > Manage Jenkins > Configure System, and locate the section titled “Jenkins Location”. You should see the warning here as well.
  2. Replace “localhost” with a valid hostname.
  3. Click Save.

How do I start Jenkins manually in Linux?

Go to the Jenkins installation, open the cmd and run:

  1. To stop: jenkins.exe stop.
  2. To start: jenkins.exe start.
  3. To restart: jenkins.exe restart.

What is Jenkins port 50000?

Jenkins runs on Tomcat, which uses port 8080 as the default. -p 5000:5000 required to attach slave servers; port 50000 is used to communicate between master and slaves.

How do I run Jenkins on port 443?

Basic solution (complete):

  1. You need a “Java keystore” of the SSL-certificate you want to use. …
  2. Copy the certificate, private key and (if present) intermediate CAs to your Jenkins host. …
  3. Convert the certificate-files to one single-filed PKCS12 container. …
  4. Make sure, that the Java “keystore”-command is present.

Leave a Comment