Developers from the Application team write the code and push it to GitHub.
Now, instead of manually building and deploying the application, we use Jenkins as a CI/CD tool to automate the entire process.
Hereβs how the flow works:
- Developers commit and push the code to GitHub.
- Jenkins is connected to the repository using a webhook. Whenever new code is pushed, Jenkins automatically triggers a pipeline.
- Jenkins pulls the latest code and starts the build process.
- During the build stage, Docker is used to create a Docker image from that code.
- The Docker image is then pushed to a container registry (like Docker Hub or ECR).
- In the deployment stage, Jenkins deploys that image either:
- On an Amazon EC2 instance, or
- On a Kubernetes cluster.
- Once the application is live, monitoring tools like Prometheus are used to monitor application health, metrics, and performance.
In Simple Terms
Jenkins acts as the brain of the CI/CD pipeline.
It automates:
- Code integration (Continuous Integration)
- Testing and building
- Docker image creation
- Deployment to servers or Kubernetes
- And ensures the whole process runs automatically whenever new code is pushed
This is the concept of CI/CD using Jenkins β automation from code commit to production deployment and monitoring, without manual intervention.
Setting Up Jenkins on AWS EC2 (Ubuntu)
Launch EC2 Instance
- Launch an Ubuntu Server EC2 instance.
- Instance type: Free Tier eligible (e.g., t2.micro).
- Storage: 15 GB (Free Tier eligible).
- Allow Port 80 in the Security Group (HTTP traffic).
- (Recommended) Also allow Port 8080 for Jenkins default access.
What is Jenkins?
Jenkins is a self-contained, open source automation server which can be used to automate all sorts of tasks related to building, testing, and delivering or deploying software.
Jenkins can be installed through native system packages, Docker, or even run standalone on any machine with a Java Runtime Environment (JRE) installed.
Installation Steps (Ubuntu/Debian)
Official Documentation:
https://www.jenkins.io/doc/book/installing/linux/#debianubuntu
Step 1: Update Packages
sudo apt update
Step 2: Install Java (Required Before Jenkins)
sudo apt install fontconfig openjdk-21-jre
java -version
On Debian/Ubuntu, it is strongly recommended to install Java before Jenkins. If Jenkins is installed first and Java is added later, the Jenkins service may fail to start with:
jenkins: failed to find a valid Java installation
Install Jenkins (Long Term Support Release)
sudo wget -O /etc/apt/keyrings/jenkins-keyring.asc \
https://pkg.jenkins.io/debian-stable/jenkins.io-2026.key
echo "deb [signed-by=/etc/apt/keyrings/jenkins-keyring.asc]" \
https://pkg.jenkins.io/debian-stable binary/ | sudo tee \
/etc/apt/sources.list.d/jenkins.list > /dev/null
sudo apt update
sudo apt install jenkins
Check Jenkins Service Status
sudo systemctl status jenkins
If the service is active and running, Jenkins has been installed successfully.
To ensure Jenkins is active and running whenever you reboot or restart your server, check whether the service is enabled:
sudo systemctl is-enabled jenkins
- If the output is
enabled, Jenkins will start automatically on boot. - If the output is
disabled, run the following command:
sudo systemctl enable jenkins
Access Jenkins in Browser
- Go to the Public IP of your EC2 instance.
- Open your browser and type:
http://<public-ip>:8080
You will see the Getting Started page.
Unlock Jenkins
You need to enter the initial admin password stored in the following file on your server:
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
Copy the password and paste it into the Jenkins setup page.
Install Plugins
After unlocking Jenkins, click on:
Install suggested plugins
Congratulations you have setup the Jenkins
βοΈ Author: Omkar Sharma
π¬ Feel free to connect on LinkedIn or explore more on GitHub









Top comments (0)