Modify the jenkins port number in Ubuntu and you will soon be able to use it. In addition, this method can be easily upgraded to the latest version. However, the port number is 8080, and another program of mine uses 8080. How can this problem be modified? Some methods on the Internet are introduced to map port 80 to port 8080 through nginx or apache, and some people say that iptables is used, which is indirect. I just don't want jenkins to use port 8080. Check/etc/init. d/jenkins script. The following two steps are required: 1. modify the check_tcp_port command of the do_start Function. Change the port number from 8080 to 8082 [plain] # Function that starts the daemon/service # do_start () {# the default location is/var/run/jenkins. pid but the parent directory needs to be created mkdir 'dirname $ pidfile'>/dev/null 2> & 1 | true chown $ JENKINS_USER 'dirname $ pidfile' # Return #0 if daemon has been started #1 if daemon was al Ready running #2 if daemon cocould not be started $ DAEMON $ DAEMON_ARGS -- running & return 1 # Verify that the jenkins port is not already in use, winstone does not exit # even for BindException check_tcp_port "http" "$ HTTP_PORT" "8082" | return 1 # If the var MAXOPENFILES is enabled in/etc/default/jenkins then set max open files to the # proper value if [-n "$ MAXOPENFILES"]; then ["$ VERBO SE "! = No] & echo Setting up max open files limit to $ MAXOPENFILES ulimit-n $ MAXOPENFILES fi # -- user in daemon doesn' t prepare environment variables like HOME, USER, LOGNAME or USERNAME, # so we let su do so for us now $ SU-l $ JENKINS_USER -- shell =/bin/bash-c "$ DAEMON $ DAEMON_ARGS -- $ JAVA $ JAVA_ARGS-jar $ JENKINS_WAR $ JENKINS_ARGS "| return 2} 2. modify the/etc/default/jenkins file, change port 8080 to 8082, and restart jenki. Ns, check: [plain] ps-def | grep java jenkins 7234 7233 99? 00:00:04/usr/bin/java-jar/usr/share/jenkins. war -- webroot =/var/cache/jenkins/war -- httpPort = 8082 -- ajp13Port =-1 modified successfully.