How to Install Jenkins on EC2 Instance? [Step-by-Step]

Jenkins is a server used to build the application and then test its code to integrate it with the existing code. Continuous Integration gets the commit integrated so the code breaks can be identified. Amazon Web Services offers its users to operate Jenkins servers using EC2 instances.

This guide will explain the installation of Jenkins on the EC2 server.

How to Install Jenkins on ECS Instance?

For the purpose of installing Jenkins on an EC2 instance, check out the following instructions.

Step 1: Install Additional Packages on the EC2 instance

To install Jenkins on an EC2 instance, it is required to have an EC2 instance created and connected using an SSH client. To learn how to do that, click here:

After connecting to the instance, type this command to get packages from the repository:

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

Import packages from the added repository:

sudo rpm --import

Then, get extra packages from Linux:

yum install epel-release

Now, install Epel on the Amazon Linux machine to use its packages:

sudo amazon-linux-extras install epel

Use the following command to install Java JDK with version 11:

amazon-linux-extras install java-openjdk11

Step 2: Install Jenkins on the EC2 instance

Finally, install Jenkins on the EC2 instance:

yum install jenkins

Step 3: Start Jenkins Service

Once the Jenkins is installed, type the following command to start Jenkins service:

service jenkins start

Check the status to verify that the Jenkins is started:

service jenkins status

Execute the following command to enable Jenkins service:

chkconfig jenkins on

Step 4: Access Jenkins Using IP Address

Head back to the EC2 dashboard and copy the Public IP of the instance:

Paste the IP address with a port number on the Web browser to access the Jenkins service:


Public IP:Port Number

Step 5: Login to the Jenkins

Jenkins will prompt the user to provide the Login password that is placed inside the following directory. Head into it to get the password:

cat /var/lib/jenkins/secrets/initialAdminPassword

Copy and paste the password on the page and click on the “Continue” button:

After that, Jenkins needs to be configured according to user requirements:

That’s all from the installation of Jenkins on the EC2 instance.


To install Jenkins on the EC2 instance, it is required to install and connect to the EC2 instance. Install the extra packages from the repository and import them on the Linux machine. After that, install Java and Jenkins using simple commands. Then start and enable the Jenkins service to access it from outside the instance. Use the IP address of the instance on the web browser to use the Jenkins server. This post has explained the installation of Jenkins on EC2 instances.

About the author

Talha Mahmood

As a technical author, I am eager to learn about writing and technology. I have a degree in computer science which gives me a deep understanding of technical concepts and the ability to communicate them to a variety of audiences effectively.