How to change the Jenkins port from 8080 to any other port?
- Chandan Rajpurohit
- Aug 11, 2021
- 1 min read
What is Jenkins?
Jenkins is a self-contained, open source automation server that can be used to automate all sorts of tasks related to building, testing, and delivering or deploying software.Jenkins can be installed through native system packages, Docker, or even run standalone by any machine with a Java Runtime Environment (JRE) installed.
Let’s come to our main question how to change the Jenkins port from 8080 to any other port?
On windows
Go to C: Program Files (x86)\Jenkins
Open Jenkins.xml.
Edit the –httpPort argument (you may need to edit default permissions)
Restart the Jenkins service.
Now Jenkins will permanently use the new port.
On Ubuntu
On Ubuntu, we can find our Jenkins configuration file under folder /etc/default/.
sudo nano /etc/default/jenkinsIn the jenkins file change the default HTTP_PORT to the port you want.
# port for HTTP connector (default 8080; disable with -1)
HTTP_PORT=8080On Linux
On Linux, we can find our Jenkins configuration file under folder /etc/sysconfig/.
sudo nano /etc/sysconfig/jenkinsIn the jenkins file change the default JENKINS_PORT to the port you want.
## Type: integer(0:65535)
## Default: 8080
## ServiceRestart: jenkins
#
# Port Jenkins is listening on.
# Set to -1 to disable
#
JENKINS_PORT="8080"
## Type: string
## Default: ""
## ServiceRestart: jenkins
Comments