Wednesday, February 2, 2022

Why I cannot access the Jenkins server from a remote PC



If you are working with a Jenkins server you might have faced this problem very often. Still, if you couldn't find a solution to fix this matter read the article till the end and you will find the solution for the problem you had for so long.

We will use the Linux (CentOS Linux - Version 8) for this article and the Jenkins version 2.238



 

First, open a web browser and type the Jenkins server IP with port 8080 to check whether you can access the Jenkins web interface without any issue. probably you will get an error like this. 

Double-check the IP of the server is correct and you have entered the port correctly.

URL Should be like below example

http://192.168.215.3:8080/



Note: The default Jenkins installation runs on ports 8080 and 8443

If the IP Address of the server and the port is all good, then we have to check the problem from the Jenkins server end.


01. Check whether Jenkins is running on the server.

#sudo server jenkins status















If the service is not running, then we have to start the service and check again.

Uploading: 40528 of 40528 bytes uploaded.
















If the service is running you can try to restart the service and try again.

02. Check port 8080 is allowed from the firewall


In order to run the Jenkins server, port 8080 should be allowed from the firewall.

Another option is to disable the firewall and check, but this is not recommended in a production environment.

03. Change the Listen address in the Jenkins configuration file.


#sudo vim /etc/sysconfig/jenkins

Go to the JENKINS_LISTEN_ADDRESS in the configuration file, change it to 0.0.0.0 and save exit from the configuration file.
























Restart the Jenkins service.

#sudo systemctl restart jenkins






04. Finally, check whether you can access the Jenkins server now.

From the Jenkins server

#curl -v http://localhost:8080
















From the remote server





No comments:

Post a Comment