Dlisk
Dlisk

Reputation: 49

Can't access Jenkins running on ec2-instance

I've tried setting up jenkins on some free-tier ec2 instances (I've tried ubuntu based and Amazon's own AMI) and despite jenkins running properly I can't access it on port 8080 using browser no matter what I try.

I've check that jenkins is running both by running sudo service jenkins status and by running curl localhost:8080 once I'm ssh'd in.

I've tried all the answers to similar questions on the web but nothing has worked. I've set up my security group exactly as all guides online state for installing jenkins on ec2 , I even went really overboard and made it overly open - nothing! Note - I've not tried setting it up behind apache/nginx but I'm feeling I shouldn't have to out of the principle that it should work on 8080

UPDATE - I caved and tried to setup Nginx using this link https://markunsworth.com/2012/02/11/setting-up-a-jenkins-build-server-on-ec2/ . I get the standard nginx welcome screen - it doesn't serve up jenkins for me

My overly open security group

Any help would be hugely appreciated

Upvotes: 4

Views: 15581

Answers (9)

Raxsi
Raxsi

Reputation: 31

I have faced similar issue in the Windows Ec2. Configured the inbound Security group and setup Custom TCP >> Protocol: TCP >> Port Range: 8080>>Source: Custom 0.0.0.0/0 . Accessed URL from browser http://url:8080, couldn't access the Jenkins.

Later in Ec2 under Control Panel\System and Security\Windows Defender Firewall >> Advanced Setting Configured the New Inbound rules for 8080 port resolved the issue.

Upvotes: 1

Vijeth Belle
Vijeth Belle

Reputation: 1

Visit https://www.jenkins.io/doc/tutorials/tutorial-for-installing-jenkins-on-AWS/

Follow the steps to create under Creating a security group

Then follow 5th step under Launching an Amazon EC2 instance

If you have already created the instance then click on that instace from instances dashboard then open Action dropdown -> Security -> Change security groups

Remove the default security group from the Security groups associated table this enables "Add security group" button

Then search for the newly created security group and select it. Then click on save button.

you should be able to access jenkins from http://<your_EC2_public_DNS>:8080

Upvotes: 0

Jakub
Jakub

Reputation: 1

In my case none of above solutions helped and in the end it was just overlooked "s" in https://instance-url:8080

when I deleted it and used http://instance-url:8080 it worked

Upvotes: -1

Vikas Sharma
Vikas Sharma

Reputation: 159

Go to the inbound tab of the Security group and do the below thing.

Type: Custom TCP

Protocol: TCP

Port Range: 8080

Source: Custom 0.0.0.0/0

Upvotes: 2

Shazeb
Shazeb

Reputation: 19

Anyone who is facing problem please make sure that your java path is correct in Windows firewall -> Inbound rule -> Jenkins right click and go to properties then program and services select your java path by browsing. I was allow to access from outside EC2 once I setup java path properly.

Upvotes: 0

Tuan Hoang
Tuan Hoang

Reputation: 696

I got same problem. To check if your Jenkins is running, you can try ps aux | grep jenkins

In my case, I was running Tomcat at port 8080, when I try that command, it shows nothing

enter image description here

Then I changed my Tomcat port and restart Jenkins by using

sudo systemctl stop jenkins
sudo systemctl start jenkins

and when I check Jenkins again, it was fine.

enter image description here

There, you can see that the port that Jenkins is using is 8080. To change the port, you can try sudo vi /etc/sysconfig/jenkins and look for JENKINS_PORT

If you config it right, you will see something like this

enter image description here

To summarize:

  1. Check Jenkins status
  2. Check Jenkins port
  3. Allow the Jenkins port on security group

Upvotes: 0

zurry8474
zurry8474

Reputation: 21

Try this steps it work for me

sudo yum update –y

sudo wget -O /etc/yum.repos.d/jenkins.repo
https://pkg.jenkins.io/redhat-stable/jenkins.repo

sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key

sudo yum upgrade

sudo yum install jenkins java-1.8.0-openjdk-devel -y

sudo systemctl daemon-reload

sudo systemctl start jenkins

sudo systemctl status jenkins

Upvotes: 1

shiva
shiva

Reputation: 23

Make sure open 8080 port on aws console, while accessing url from browser, by default it use https://* , try to access with http.

Upvotes: 0

DimiDak
DimiDak

Reputation: 5641

You need to open 8080 port in AWS.

Check this to do it: https://hayato-iriumi.net/2019/08/22/how-to-install-jenkins-on-aws/

After that you 're good to go by using the public IP of the EC2 and port 8080 :)

enter image description here

Upvotes: 5

Related Questions