How To Change Jenkins Default Port? A Step-By-Step Guide

Step 1: Firstly ensure that you have already setup the Jenkins software and the Jenkins server is in a running state. For the installation of Jenkins refer this – Install Jenkins

Step 2: Verify the os of the current VM. To change the default port on which Jenkins runs, you typically need to modify the Jenkins configuration file. The steps may vary depending on your installation method and operating system. For demonstration purposes Now we have to take the Amazon Linux os.

Step 3: Accessing the jenkins using the default port number.

Step 4: Locate the jenkins service file and check the which port currently using the jenkins. verify the below image and the current port number is 8080.

  • For best practice initially we need to stop the service and after change the service again start uaing the below commands.
sudo systemctl stop jenkins.service
sudo ststemctl start jenkins.service
cat /lib/systemd/system/jenkins.service

Step 5: We have changed the port numner to 9090. Using the below command we can change the port number of the jenkins on service file.

vi /lib/systemd/system/jenkins.service

  • Step 6: Accessing the changed port through the browser.

Step 7: For other os like ubuntu, redhat …etc. You can modify by uisng the below procedure.

sudo vi /etc/default/jenkins
  • Identify the below one and change the port
# port for HTTP connector (default 8080; disable with -1)
HTTP_PORT=8080
  • Change like below
HTTP_PORT=9090
  • After changing restart the jenkins server using the below command.
sudo systemctl restart jenkins.service.

How to Change the Port in Jenkins?

Configuring the port in Jenkins is a fundamental aspect of managing the Jenkins server. By default, Jenkins runs on port 8080, but there are scenarios where you may need to change this port, such as to avoid conflicts with other services or for security reasons. Understanding how to configure the port in Jenkins ensures smooth operation and accessibility of the Jenkins server. This guide will walk you through the process of changing the port in Jenkins, providing step-by-step instructions and helpful tips along the way.

Similar Reads

Understanding Of Default Jenkins Port

Jenkins typically runs on port 8080 by default. This port serves as the entry point for accessing the Jenkins web interface. It’s like the front door to your Jenkins server, where you can manage jobs, view build status, and configure settings. Port 8080 is chosen because it’s commonly available and not usually occupied by other services. When you type “http://localhost:8080” in your web browser, Jenkins listens on this port and responds, allowing you to interact with the Jenkins server through its user interface....

How To Change Jenkins Default Port? A Step-By-Step Guide

Step 1: Firstly ensure that you have already setup the Jenkins software and the Jenkins server is in a running state. For the installation of Jenkins refer this – Install Jenkins...

How To Change Port For Jenkins In Windows : A Step-By-Step Guide

Modifying the Jenkins port number necessitates updating the jenkins.xml configuration file if the Jenkins application is installed on a Windows computer. This file is located in the Jenkins install folder (C:\Program Files\Jenkins\jenkins.xml is the normal path)....

Change The Port In Jenkins – FAQ’s

How To Change The Jenkins Default Port?...

Contact Us