Install Jenkins on AWS EC2 Instance

In the previous post we’ve seen how to install Java on AWS EC2, this tutorial will be a continuation of it, So if you haven’t seen previous tutorial, I would highly recommend to go through the same.

In this tutorial we will be seeing how to install Jenkins on AWS EC2 instance.

From the last tutorial, we’ve already installed Java and added the path variable now let’s install Jenkins

Step 1: Use the below command, here Wget command is a Linux command line utility that helps us to download the files from the web and YUM (Yellowdog Updater Modified) is an open source command-line as well as graphical based package management tool for RPM (RedHat Package Manager) based Linux systems. It allows users and system administrator to easily install, update, remove or search software packages on a systems.

$sudo yum -y install wget

$sudo wget -O /etc/yum.repos.d/jenkins.repo

$sudo rpm --import

$sudo yum -y install jenkins

That’s all it will install Jenkins on the your Red Hat server you should see something like this on completion

This image has an empty alt attribute; its file name is screen-shot-2019-12-12-at-12.42.07-pm.png

To reverify the installation you can check the Jenkins status

$sudo service jenkins status
This image has an empty alt attribute; its file name is screen-shot-2019-12-12-at-12.44.52-pm.png

Step 2: Now let’s start our Jenkins using below command and setup jenkins to boot at start

# Start jenkins
systemctl start jenkins

#Jenkins to start at boot,
systemctl enable jenkins

Step 2: Now let’s open Jenkins using our browser, open AWS Console and grab the IPv4 Public IP address of our server and copy paste on web browser appended by “:” and port no which is “8080”, in my case it will be 5.37.348.318:8080

If all goes well you should be able to see below screen on your browser

Step 3: Now let’s grab the password copy paste red color path in our terminal.

$sudo cat /var/lib/jenkins/secrets/initialAdminPassword

Copy paste below password and you’re done!!

Let me know in the comment section if you’ve any query or doubt.

One thought on “Install Jenkins on AWS EC2 Instance

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s