Install Jenkins on AWS EC2 Instance

Shrihari Haridas
3 min readJan 7, 2023

--

1. What is Jenkins…?

Jenkins is an open-source automation server. It helps automate the parts of software development related to building, testing, and deploying, facilitating continuous integration and continuous delivery.

2. Step to Install Jenkins on AWS EC2 Instance

1. Login to your AWS Account

2. Then go to launch instance

3. Use Amazon Linux as OS(AMI) => Amazon Linux 2 Kernel 5.10 AMI 2.0.20230404.1 x86_64 HVM gp2

Select Amazon Linux OS

4. Open port 8080 globally (Jenkins Use port 8080 default)

Open Port 8080 Globally

5. Launch Instance

We successfully launch EC2 Instance

6. Connect you EC2 with the help of putty or AWS console

Connect your machine

7. First update your instance

sudo yum update

8. Add the Jenkins repo using below command

sudo wget -O /etc/yum.repos.d/jenkins.repo \
https://pkg.jenkins.io/redhat-stable/jenkins.repo
Add Jenkins repo

9. Import a key file from Jenkins CI to install package

sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io-2023.key
Import Key

10. Again upgrade your machine

sudo yum upgrade
Update your machine again

11. Then install java on your machine

sudo amazon-linux-extras install java-openjdk11 -y
Install Java

12. finally install Jenkins

sudo yum install jenkins -y
Jenkins Installed Successfully

13. Now enable & start Jenkins service

sudo systemctl enable jenkins
sudo systemctl start jenkins
enable and start Jenkins service

14. Now check Jenkins status

sudo systemctl status jenkins
Jenkins in start now

15. hit public IP along with port number and your Jenkins is successfully installed on your machine

Jenkins Installs Successfully

--

--

Shrihari Haridas
Shrihari Haridas

Written by Shrihari Haridas

Hello everyone, I am Shrihari Haridas I am a Cloud & DevOps Engineer, I work with most of DevOps Tools like, Jenkins, Git, Docker, etc.!& for Cloud AWS

No responses yet