Jenkins does not get bound to the given IP Address

I am trying to learn DevOps. I have windows 11 over which I have installed Ubuntu 22.04.4 LTS using OracleBox VM. I have a wireless network, whose IP address is for example 188.213.167.30
I installed Jenkins on it using these commands:

curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo tee \
  /usr/share/keyrings/jenkins-keyring.asc > /dev/null

echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
  https://pkg.jenkins.io/debian-stable binary/ | sudo tee \
  /etc/apt/sources.list.d/jenkins.list > /dev/null

sudo apt-get update

sudo apt-get install jenkins

Here is the /etc/default/jenkins file:

# defaults for Jenkins automation server

# pulled in from the init script; makes things easier.
NAME=jenkins

# arguments to pass to java

# Allow graphs etc. to work even when an X server is present
JAVA_ARGS="-Djava.awt.headless=true"

#JAVA_ARGS="-Xmx256m"

# make jenkins listen on IPv4 address
#JAVA_ARGS="-Djava.net.preferIPv4Stack=true"

PIDFILE=/var/run/$NAME/$NAME.pid

# user and group to be invoked as (default to jenkins)
JENKINS_USER=$NAME
JENKINS_GROUP=$NAME

# location of the jenkins war file
JENKINS_WAR=/usr/share/java/$NAME.war

# jenkins home location
JENKINS_HOME=/var/lib/$NAME

# set this to false if you don't want Jenkins to run by itself
# in this set up, you are expected to provide a servlet container
# to host jenkins.
RUN_STANDALONE=true

# log location.  this may be a syslog facility.priority
JENKINS_LOG=/var/log/jenkins/jenkins.log
JENKINS_LOG=daemon.info

# Whether to enable web access logging or not.
# Set to "yes" to enable logging to /var/log/$NAME/access_log
JENKINS_ENABLE_ACCESS_LOG="no"

# OS LIMITS SETUP
#   comment this out to observe /etc/security/limits.conf
#   this is on by default because http://github.com/jenkinsci/jenkins/commit/2fb288474e980d0e7ff9c4a3b768874835a3e92e
#   reported that Ubuntu's PAM configuration doesn't include pam_limits.so, and as a result the # of file
#   descriptors are forced to 1024 regardless of /etc/security/limits.conf
MAXOPENFILES=8192

# set the umask to control permission bits of files that Jenkins creates.
#   027 makes files read-only for group and inaccessible for others, which some security sensitive users
#   might consider benefitial, especially if Jenkins runs in a box that's used for multiple purposes.
#   Beware that 027 permission would interfere with sudo scripts that run on the master (JENKINS-25065.)
#
#   Note also that the particularly sensitive part of $JENKINS_HOME (such as credentials) are always
#   written without 'others' access. So the umask values only affect job configuration, build records,
#   that sort of things.
#
#   If commented out, the value from the OS is inherited,  which is normally 022 (as of Ubuntu 12.04,
#   by default umask comes from pam_umask(8) and /etc/login.defs

# UMASK=027

HTTP_HOST=188.213.167.30

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


# servlet context, important if you want to use apache proxying
PREFIX=/$NAME

# arguments to pass to jenkins.
# full list available from java -jar jenkins.war --help
# --javaHome=$JAVA_HOME
# --httpListenAddress=$HTTP_HOST (default 0.0.0.0)
# --httpPort=$HTTP_PORT (default 8080; disable with -1)
# --httpsPort=$HTTP_PORT
# --argumentsRealm.passwd.$ADMIN_USER=[password]
# --argumentsRealm.roles.$ADMIN_USER=admin
# --webroot=~/.jenkins/war
# --prefix=$PREFIX

JENKINS_ARGS="--webroot=/var/cache/$NAME/war --httpPort=$HTTP_PORT"


I just want jenkins to listen to 188.213.167.30 ip address but it does not respond:

When I do What is my IP : I get: 188.213.167.30
but when I do ifconfig, I get :

devops@123456:~$ ifconfig
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.2.15  netmask 255.255.255.0  broadcast 10.0.2.255

I allowed port:
sudo ufw allow 8080

jenkins.log file is here:

Apr 17 15:59:54 123456 systemd[1]: jenkins.service: Main process exited, code=exited, status=1/FAILURE
Apr 17 15:59:54 123456 systemd[1]: jenkins.service: Failed with result 'exit-code'.
Apr 17 15:59:54 123456 systemd[1]: Failed to start Jenkins Continuous Integration Server.
Apr 17 15:59:54 123456 systemd[1]: jenkins.service: Consumed 1.943s CPU time.
Apr 17 15:59:55 123456 systemd[1]: jenkins.service: Scheduled restart job, restart counter is at 79.
Apr 17 15:59:55 123456 systemd[1]: Stopped Jenkins Continuous Integration Server.
Apr 17 15:59:55 123456 systemd[1]: jenkins.service: Consumed 1.943s CPU time.
Apr 17 15:59:55 123456 systemd[1]: Starting Jenkins Continuous Integration Server...
Apr 17 15:59:56 123456 jenkins[295019]: Running from: /usr/share/java/jenkins.war
Apr 17 15:59:58 123456 jenkins[295019]: 2024-04-17 12:59:58.573+0000 [id=1]        INFO        winstone.Logger#logInternal: Beginning extraction from war f>
Apr 17 15:59:58 123456 jenkins[295019]: 2024-04-17 12:59:58.994+0000 [id=1]        WARNING        o.e.j.s.handler.ContextHandler#setContextPath: Empty cont>
Apr 17 15:59:59 123456 jenkins[295019]: 2024-04-17 12:59:59.300+0000 [id=1]        INFO        org.eclipse.jetty.server.Server#doStart: jetty-10.0.20; buil>
Apr 17 15:59:59 123456 jenkins[295019]: 2024-04-17 12:59:59.355+0000 [id=1]        INFO        org.eclipse.jetty.server.Server#doStop: Stopped Server@1d76a>
Apr 17 15:59:59 123456 jenkins[295019]: 2024-04-17 12:59:59.357+0000 [id=1]        INFO        winstone.Logger#logInternal: Jetty shutdown successfully
Apr 17 15:59:59 123456 jenkins[295019]: java.io.IOException: Failed to start Jetty
Apr 17 15:59:59 123456 jenkins[295019]:         at winstone.Launcher.<init>(Launcher.java:209)
Apr 17 15:59:59 123456 jenkins[295019]:         at winstone.Launcher.main(Launcher.java:496)
Apr 17 15:59:59 123456 jenkins[295019]:         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Apr 17 15:59:59 123456 jenkins[295019]:         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
Apr 17 15:59:59 123456 jenkins[295019]:         at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Apr 17 15:59:59 123456 jenkins[295019]:         at java.base/java.lang.reflect.Method.invoke(Method.java:568)
Apr 17 15:59:59 123456 jenkins[295019]:         at executable.Main.main(Main.java:351)
Apr 17 15:59:59 123456 jenkins[295019]: Caused by: java.io.IOException: Failed to bind to /88.113.67.130:8080
Apr 17 15:59:59 123456 jenkins[295019]:         at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:344)
Apr 17 15:59:59 123456 jenkins[295019]:         at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:304)
Apr 17 15:59:59 123456 jenkins[295019]:         at org.eclipse.jetty.server.Server.lambda$doStart$0(Server.java:402)
Apr 17 15:59:59 123456 jenkins[295019]:         at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
Apr 17 15:59:59 123456 jenkins[295019]:         at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
Apr 17 15:59:59 123456 jenkins[295019]:         at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
Apr 17 15:59:59 123456 jenkins[295019]:         at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
Apr 17 15:59:59 123456 jenkins[295019]:         at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
Apr 17 15:59:59 123456 jenkins[295019]:         at java.base/sun.nio.ch.Net.bind(Net.java:555)
Apr 17 15:59:59 123456 jenkins[295019]:         at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
Apr 17 15:59:59 123456 jenkins[295019]:         at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
Apr 17 15:59:59 123456 systemd[1]: Stopped Jenkins Continuous Integration Server.
Apr 17 16:18:48 123456 jenkins[317540]: 2024-04-17 13:18:48.915+0000 [id=1]        INFO        hudson.WebAppMain#contextInitialized: Jenkins home directory>
Apr 17 16:18:50 123456 jenkins[317540]: 2024-04-17 13:18:50.415+0000 [id=31]        INFO        jenkins.InitReactorRunner$1#onAttained: Started initializat>
Apr 17 16:18:50 123456 jenkins[317540]: 2024-04-17 13:18:50.437+0000 [id=31]        INFO        jenkins.InitReactorRunner$1#onAttained: Listed all plugins
Apr 17 16:18:53 123456 jenkins[317540]: 2024-04-17 13:18:53.926+0000 [id=31]        INFO        jenkins.InitReactorRunner$1#onAttained: Loaded all jobs
Apr 17 16:18:53 123456 jenkins[317540]: 2024-04-17 13:18:53.927+0000 [id=31]        INFO        jenkins.InitReactorRunner$1#onAttained: Configuration for a>
Apr 17 16:18:55 123456 jenkins[317540]: *************************************************************
Apr 17 16:18:55 123456 jenkins[317540]: Jenkins initial setup is required. An admin user has been created and a password generated.
Apr 17 16:18:55 123456 jenkins[317540]: *************************************************************
Apr 17 16:19:51 123456 jenkins[317540]: 2024-04-17 13:19:51.654+0000 [id=47]        INFO        hudson.util.Retrier#start: Performed the action check updat>
Apr 17 16:23:49 123456 jenkins[317540]: 2024-04-17 13:23:49.735+0000 [id=17]        INFO        hudson.model.UpdateSite$Plugin#deploy: Adding dependent ins>
Apr 17 16:23:49 123456 jenkins[317540]: 2024-04-17 13:23:49.735+0000 [id=17]        INFO        hudson.model.UpdateSite$Plugin#deploy: Adding dependent ins>
Apr 17 16:23:49 123456 jenkins[317540]: 2024-04-17 13:23:49.736+0000 [id=17]        INFO        hudson.model.UpdateSite$Plugin#deploy: Adding dependent ins>
Apr 17 16:23:49 123456 jenkins[317540]: 2024-04-17 13:23:49.741+0000 [id=17]        INFO        hudson.model.UpdateSite$Plugin#deploy: Adding dependent ins>
Apr 17 16:23:49 123456 jenkins[317540]: 2024-04-17 13:23:49.745+0000 [id=17]        INFO        hudson.model.UpdateSite$Plugin#deploy: Adding dependent ins>
Apr 17 16:23:49 123456 jenkins[317540]: 2024-04-17 

Any help will be greatly appreciated.

To what does the IP 188.213.167.30 belong? It it what you get when you open https://whatismyipaddress.com/
You can’t bind to this IP inside your VM.
Also if you would be able to bind to this IP you would make your Jenkins reachable to everyone, something you most likely don’t want. Also using http and not https is bad.

Jenkins should bind to 0.0.0.0 and then you need to define a port mapping between windows and your vm so that when someone accesses the port in your windows machine the traffic is forwarded to your vm. Don’t ask me for details how this is done

1 Like

Welcome to the Jenkins community.

I think that you’ll have a much better experience if you follow the Jenkins installation instructions rather than following that tutorial. That tutorial is badly outdated, even though it is titled “2024”. Some of the issues in that tutorial include:

I suspect that there are more errors in that tutorial. The Jenkins installation instructions and the Jenkins tutorials will provide a better experience for you.

2 Likes