All Courses
Install Java and Jenkins on AMI instance Tutorial

In this tutorial, We can know about the steps on how to install Java and Jenkins on AMI Instance. Let’s begin it now.

1. For new instances, update your AMI instance

$ sudo yum update -y

2. Java is required to install and run Jenkins. Install Java first

$ java –version

If your Java version is less than 1.8, you will need to upgrade to 1.8. The minimum version is 1.8.

$ wget –no-check-certificate –no-cookies –header “Cookie: oraclelicense=accept-securebackup-cookie”

http://download.oracle.com/otn-pub/java/jdk/8u141-b15/336fa29ff2bb4ef291e347e091f7f4a7/jdk-8u141-linux-x64.rpm

$ sudo yum install -y jdk-8u141-linux-x64.rpm

Next, check the Java version.

$ java –version
Install Java and Jenkins on AMI instance

3. Now install Jenkins

4. Update the Yum package management tool.

$ sudo yum update –y

5. Download the latest Jenkins code package.

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

6. Import the key file from Jenkins-CI and allow the installation from the package.

$ sudo rpm –import https://pkg.jenkins.io/redhat/jenkins.io.key

7. Install Jenkins.

$ sudo yum install jenkins -y

8. Start Jenkins as a service.

$ sudo service jenkins start

9. To start the Jenkins service at boot-up, you can run.

$ sudo chkconfig jenkins on

10. Go to the Jenkins URL.

http://yourserverip:8080/

11. As stated on the interface, this password is located at /var/lib/jenkins/secrets/initialAdminPassword. Paste the value into the password box, then choose and continue…

Finally, we have done every process to Install Java and Jenkins on AMI instance.