3

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

TAMIM HAIDER
  • 641
  • 1
  • 10
  • 19
Dlisk
  • 39
  • 1
  • 1
  • 5

9 Answers9

4

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

DimiDak
  • 4,820
  • 2
  • 26
  • 32
1

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.

Raxsi
  • 31
  • 3
0

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

shiva
  • 23
  • 2
0

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

0

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
Tuan Hoang
  • 586
  • 1
  • 7
  • 14
  • To whoever voted down: please give me the reason why I got voted down when I was trying to help with the answer and also the proved that the solution works. – Tuan Hoang Apr 18 '22 at 16:15
0

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.

Shazeb
  • 19
  • 4
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Sep 15 '22 at 06:57
0

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

Vikas Sharma
  • 129
  • 2
  • 4
0

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

-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

Jakub
  • 1