Monday, February 14, 2022

Jenkins : Changing Port Number

 

CONTEXT

Most services that get installed on your machine usually tend to use the the 8080 port as their default. Even when you develop a Web App, the default port is mostly 8080 unless you go and configure it to be something else. Jenkins is just one of those apps that use the port 8080 is the default.

So let’s do a quick run on changing the port number to something you would prefer especially if you missed this the first time when you were setting up Jenkins on the server.

 

LINUX OS

Look for the main Jenkins Profile, file on the server. Mostly in the path : /etc/default/jenkins and use your favourite text editor to change an Environment Variable in that file.

 

Change Jenkins Port : Linux OS


Change that port number to the new number that you intend to use from now on and then you can save your changes. Remember that you must restart Jenkins.

 

MAC OS

The way you installed Jenkins on Mac OS plays a huge role on this one. In my case I have installed Jenkins using Homebrew Package manager. I chose to believe that you have installed it the same way. Is that’s the case then look for a Mac OS system process file. This file extension should be ending in ..plist. The path is : /usr/local/Cellar/jenkins-lts/${jenkins-version}/homebrew.mxcl.jenkins-lts.plist .

 

NB : Pay close attention to this path above and replace ${jenkins-version} with your target version.

 

Use your favourite text editor to change the port number as show in the image below :

 

Change Jenkins Port : Mac OS

 

You will notice that I changed my port number to 8001 for fun. So you go for it as well and then save your changes and remember to restart.

 

CONCLUSION

It’s always the little things that matter the most in the world. I hope this was helpful and you will find it useful as you are working with tools like Jenkins. Cheers!

 

 

 

No comments:

Post a Comment