I am trying to install jenkins in ubuntu. I have followed the commands below:
wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | apt-key add -
echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list
then
apt-get update
and
apt-get install jenkins
but It shows
- Starting Jenkins Continuous Integration Server Jenkins The selected http port (8080) seems to be in use by another program Please select another port to use for jenkins
Need help on how to set a different port for Jenkins to run.
For others still looking for answers you can go to
/etc/sysconfig/jenkins
in CentOS/RHEL or/etc/default/jenkins
in Debian based distributions and change theJENKINS_PORT=
variable to whatever port you want. Restart jenkins, and it should be running on your desired port.First, run this command:
The only place you need to change is:
There you change to the desired port. For example:
Finally, run this command:
Then you're ready to open it with a new port.
step 1 : sudo nano /etc/default/jenkins open the nano file And change HTTP PORT:8080 to HTTP PORT : 8081
CTL+X and Click Y and ENTER
PORT will changing from 8080 to 8081 restart the jenkins
sudo service jenkins restart
In my case,I add
when defining the variables at the beginning of
/etc/default/jenkins
,it works .You can go to
/etc/default/jenkins
and add--httpPort=9999
or whatever port toJENKINS_ARGS
.Then you should restart Jenkins with
sudo service jenkins restart
.