Voiced by Amazon Polly |
Introduction
Jenkins is an open-source automation server generally meant for continuous integration (CI) and continuous delivery (CD) processes in software development. It is a platform for automating the CICD for building, testing, and deploying software applications. If the development team needs to streamline the workflow, they can use Jenkins to increase efficiency and maintain code quality through automated processes.
The steps to Install Jenkins on an Amazon EC2 instance comprise several steps. Here’s a general outline of the process:
- First, Launch an EC2 Instance, and in the security group of the instance, open port 8080.
- SSH into the EC2 Instance. To SSH into the instance, go to the instance and connect through EC2 Instance Connect.
- Next, Install Jenkins on the EC2 instance. Enter the following command to check whether all the software packages are up to date.
$sudo yum update
- To add Jenkins repo, enter the below command.
sudo wget -O /etc/yum.repos.d/jenkins.repo \
https://pkg.jenkins.io/redhat-stable/jenkins.repo
Freedom Month Sale — Upgrade Your Skills, Save Big!
- Up to 80% OFF AWS Courses
- Up to 30% OFF Microsoft Certs
- Import a key file from Jenkins-CI to enable installation from the package:
$ sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io-2023.key
$ sudo yum upgrade
- Based on the AMI of the EC2 Instance, Install
Java on the EC2 using the following Commands- To Install Java on EC2 with Amazon Linux 2 AMI, enter the command given below
$ sudo amazon-linux-extras install java-openjdk11 -y
- To Install Java on EC2 with Amazon Linux 2023 AMI, Enter the below command
Now, after Installing Java, Install Jenkins on the EC2 Instance
$ sudo dnf install java-11-amazon-corretto -y
ec2-user ~]$ sudo yum install jenkins -y
- To Install Java on EC2 with Amazon Linux 2 AMI, enter the command given below
- To Start Jenkins, we must first enable the Jenkins service on an EC2 Instance to Start the boot.
$ sudo systemctl enable jenkins
- After enabling ‘start,’ run the Jenkins on EC2 Instance.
$ sudo systemctl start jenkins
- To check the status of the Jenkins service, use the following command:
$ sudo systemctl status jenkins
Configuring Jenkins on EC2
Jenkins is now installed and running on your EC2 instance. To configure Jenkins:
- To connect to the Jenkins server from your web browser, enter the following:
http://:8080
It will restart your Jenkins, as shown below.
This step ensures you configure Jenkins on EC2 Instance.You can launch the Jenkins and access it through the management Interface.
E.g.,http://126.32.18.3:8080
To find the Public IP of the Instance, click on the EC2 instance and copy the Public IP of the Instance. You should get this Website as shown below.
- Password is stored in the following path in jenkins
/var/lib/jenkins/secrets/initialAdminPassword.
- To locate the password, use the command below
$ sudo cat /var/lib/jenkins/secrets/initialAdminPassword
- Copy and paste the Admin Password in the Browser to log in and continue.
Install the suggested Plugins on that Jenkins that the installation script directs you to customize the Jenkins page.
- Now, Create an Admin user and configure the Password for your Jenkins Server. You must enter the login name and password every time you log in.
- Select Manage Jenkins, and then select Manage Plugins mentioned on the left-hand side of the menu.
- Select Plugins, and in the Available tab, search for Amazon EC2 Plugin in the Search.
- Next to Amazon EC2 Plugin, Select the checkbox to install the Plugin on Jenkins, then Choose Install without restart.
- Follow the same steps and Install the Following Plugins as shown below:
• Amazon EC2
• Codepipeline Plugin
Install the Codepipeline Plugin to integrate with the AWS CICD pipeline.
- Select the checkbox “Restart Jenkins when Installation is complete and no jobs are Running.”
Login with your new Sign-in credentials.
Once you log in, click on the Check Box.
Conclusion
Installing Jenkins on an Amazon EC2 instance can significantly enhance your continuous integration and continuous delivery (CI/CD) processes. By leveraging the scalability and flexibility of EC2, along with Jenkins’ robust automation capabilities, you can modernize software development, testing, and deployment workflows. Several key points to be noted throughout the process are Infrastructure Choice, Security Considerations, Installation Steps, Configuration, and Plugins. You can integrate the AWS CICD pipeline with Jenkins as a build server.
By successfully installing Jenkins on an EC2 instance and incorporating it into your development cycle, you’re taking a significant step towards achieving faster, more efficient software delivery.
References
Freedom Month Sale — Discounts That Set You Free!
- Up to 80% OFF AWS Courses
- Up to 30% OFF Microsoft Certs
About CloudThat
CloudThat is an award-winning company and the first in India to offer cloud training and consulting services worldwide. As a Microsoft Solutions Partner, AWS Advanced Tier Training Partner, and Google Cloud Platform Partner, CloudThat has empowered over 850,000 professionals through 600+ cloud certifications winning global recognition for its training excellence including 20 MCT Trainers in Microsoft’s Global Top 100 and an impressive 12 awards in the last 8 years. CloudThat specializes in Cloud Migration, Data Platforms, DevOps, IoT, and cutting-edge technologies like Gen AI & AI/ML. It has delivered over 500 consulting projects for 250+ organizations in 30+ countries as it continues to empower professionals and enterprises to thrive in the digital-first world.

WRITTEN BY Deepa Dharanendra Saibannavar
Comments