Sunday, April 28, 2024
 Popular · Latest · Hot · Upcoming
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 3963  / 3 Years ago, thu, august 5, 2021, 12:47:57

I have Ubuntu 20.04 and Jenkins 1.3.3
I need to change the local Jenkins port from 8080 to 8888.


I tried to change the config file sudo gedit /etc/default/jenkins in the string


#port for HTTP connector (default 8080; disable with -1)
HTTP_PORT=8888

After restart service: sudo service jenkins start it doesn't affect changes. I still visit jenkins with 8080 port.


Also in this config file I add additional string: JENKINS_ARGS="--httpPort=$HTTP_PORT" but unfortunately after restart service the same - 8080.


I tried to change the address via web interface in the Manage Jenkins next Configure System next change string Jenkins URL to http://0.0.0.0:8888/ and apply and restart service. I visited page http://0.0.0.0:8080/cli/command/who-am-i and have got next features:


java -jar jenkins-cli.jar -s http://0.0.0.0:8888/ -webSocket who-am-i
Reports your credential and permissions.

So changes are saved but doesn't affect. I tried to restart my PC to initial all changes.
Can You help me? Any suggestions?


More From » jenkins

 Answers
7

Refer to the documentations in:
https://www.jenkins.io/doc/book/installing/linux/#debianubuntu


It says that you can modify by:


systemctl edit jenkins

Then add the following lines:



[Service] Environment="JENKINS_PORT=8888"



Port should be your desired port to use. Save it and then restart jenkins:


sudo systemctl restart jenkins

[#721] Thursday, August 5, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tudatchful

Total Points: 270
Total Questions: 109
Total Answers: 122

Location: Palau
Member since Tue, May 30, 2023
12 Months ago
;