Changing default Jenkins PORT to 9090 as tomcat is using the same PORT

Hi all,

I am new to Jenkins and trying to deploy the .war application using tomcat with Jenkins pipeline.

I have installed Jenkins successfully to my AWS Ubuntu server. The issue I am facing is I have

  • List item

changed the default port in the jenkinsfile from 8080 to 9090
restarted the service Jenkins
checked the web page :9090 - error - This site can’t be reached
then tried the command java -jar jenkins.war --httpPort=9090 in the path /usr/share/java and was working fine when I press CTRL+C, then web page again disappread

and the log is
h.m.UpdateCenter$CompleteBatchJob#run: Completing installing of plugin batch…
2022-07-26 INFO h.p.b.g.GlobalTimeOutConfiguration#load: global timeout not set
^C2022-07-26 INFO winstone.Logger#logInternal: JVM is terminating. Shutting down Jetty
2022-07-26 INFO h.m.DownloadService$Downloadable#load: Obtained the updated data file for hudson.tasks.Ant.AntInstaller

I have JAVA installed and nothing running in the server.

Could someone please help me what I am doing wrong here?

I found the solution
The question is about ubuntu 12, but this not used anymore. In modern debian/ubuntu systems take a look into:

/usr/lib/systemd/system/jenkins.service

change the port in the line

Environment="JENKINS_PORT=8080"

The port is still in /etc/default/jenkins but the change there is useless. Tested in debian11.3

Sharing here it might help someone

2 Likes

Hi Rensur,

Jenkins 2.332.1 switched Jenkins from using System V init to use systemd with its Linux package installers for Debian, Ubuntu, Red Hat, Alma, openSUSE, Rocky, and more. The LTS Upgrade Guide describes that transition and how to adapt your environment to the transition.

There is a blog post about it as well at

There is also a video introduction for RPM based distributions like Red Hat Enterprise Linux, Alma Linux, Rocky Linux, Oracle Linux, and Amazon Linux.

There is also a video introduction for deb based distributions like Debian and Ubuntu

1 Like