INT 331 FUNDAMENTALS OF DEVOPS
Implementation of DevOps CI/CD Pipeline Using
Jenkins and Docker on AWS EC2
SUBMITTED TO:
Dr. Omdev
SUBMITTED BY:
Name: Sai Prashanth Bondalkunta
Registration No: 12300951
Roll No: 26
1. Introduction
1.1 Background
In modern software development, manual build and deployment processes are slow, error-prone,
and difficult to manage. Development teams often face issues such as inconsistent environments,
delayed releases, and lack of visibility into system health. To address these challenges, DevOps
practices aim to integrate development and operations through automation and continuous
feedback.
This project focuses on implementing a practical DevOps workflow using industry-standard tools to
automate application build, deployment, and monitoring.
1.2 Purpose of the Project
The purpose of this project is to demonstrate the implementation of DevOps concepts such as
Continuous Integration, Continuous Deployment, containerization, cloud deployment, configuration
management, and monitoring using a simple application.
The emphasis of the project is on DevOps automation and lifecycle, rather than application
complexity.
2. Project Objectives
The main objectives of this project are:
To implement version control using Git and GitHub
To containerize an application using Docker
To automate build and deployment using Jenkins
To deploy the application on cloud infrastructure (AWS EC2)
To automate server configuration using Ansible
To introduce continuous monitoring using Nagios
To demonstrate an end-to-end DevOps CI/CD pipeline
3. Tools and Technologies Used
Category Tool
Version Control Git,
GitHub Programming Language
[Link]
Containerization Docker
CI/CD Tool Jenkins
Cloud Platform Amazon Web Services
(EC2) Configuration Management Ansible
Monitoring Nagios
Operating System Ubuntu Linux
3.1 Justification of Tool Selection
Git & GitHub: Used for source code management and as the trigger point for
CI/CD automation.
Docker: Ensures consistent runtime environments and simplifies deployment.
Jenkins: Provides automation for build and deployment pipelines and aligns with enterprise
DevOps practices.
AWS EC2: Offers scalable and reliable cloud infrastructure suitable for real-
world deployment.
Ansible: Automates system configuration and ensures reproducible environments.
Nagios: Enables basic system monitoring and represents the operations phase of DevOps.
4. Project Architecture
The architecture of the project follows a simple and effective DevOps pipeline model:
Workflow:
1. Developer pushes code to GitHub repository
2. GitHub webhook triggers Jenkins pipeline
3. Jenkins pulls source code and builds Docker image
4. Docker container is deployed on AWS EC2
5. Application runs on EC2 and is accessible via public IP
6. Nagios monitors system health
This architecture enables automated and continuous delivery of the application.
5. Application Overview
A simple [Link] application was developed for this project. The application provides a basic HTTP
response and runs on port 3000.
The application was intentionally kept minimal to ensure that the focus remains on DevOps
automation, deployment, and monitoring rather than application logic.
6. Version Control Implementation
6.1 Git Repository Setup
The project source code was managed using Git. A Git repository was initialized, and all application
and configuration files were tracked using commits.
6.2 GitHub Integration
The local repository was connected to a remote GitHub repository. GitHub acted as the central source
of truth and provided integration with Jenkins for automated pipeline execution.
git init
git add
git commit -m "Adding node project"
git remote add origin [Link]
git push -u origin main
7. Application Containerization Using Docker
7.1 Local Application Development
The project began with the development of a simple [Link] application on the local system. The
application exposes a basic HTTP endpoint and listens on port 3000. The application logic was
intentionally kept minimal to ensure the focus remained on DevOps automation rather than
application complexity.
7.2 Docker Installation (Local System)
Docker was installed on the local development system to enable containerization of the application.
Docker provides a consistent runtime environment by packaging the application along with its
dependencies.
Docker installation was verified using:
docker --version
7.3 Dockerfile Creation
The application was containerized using Docker. A Dockerfile was created to define the runtime
environment and application dependencies.
Dockerfile:
FROM node:18-alpine
WORKDIR /app
COPY app/[Link] ./
RUN npm install
COPY app/[Link] ./
EXPOSE 3000
CMD ["node", "[Link]"]
7.4 Benefits of Docker
Ensures environment consistency
Reduces dependency conflicts
Simplifies cloud deployment
Enables faster CI/CD execution
The application was accessed locally using:
[Link]
This step served as a baseline verification before moving to cloud deployment.
8. Cloud Infrastructure Setup (AWS EC2)
8.1 EC2 Instance Creation
An AWS EC2 instance was created using the AWS Management Console with the following
configuration:
Instance Type: Free-tier eligible
Operating System: Ubuntu Linux
Key Pair: Used for secure SSH access
Security Group: Allowed inbound traffic on ports:
o 22 (SSH)
o 8080 (Jenkins)
o 3000 (Application)
This step provided a cloud-based Linux server for hosting Jenkins and the application.
8.2 Connecting to EC2 Using SSH
The EC2 instance was accessed securely using SSH and the key pair.
ssh -i <key-file>.pem ubuntu@<public-ip>
SSH access allowed remote management and configuration of the cloud server.
8.3 Linux Environment Preparation
Once connected to EC2, the system was updated and required packages were installed using apt.
sudo apt update
sudo apt install [Link] git -y
Docker service was verified and started:
sudo systemctl start docker
sudo systemctl enable docker
9. Jenkins Installation and Configuration
9.1 Jenkins Installation
Jenkins was installed on the EC2 instance using the official Jenkins repository.
sudo apt install openjdk-17-jdk -y
sudo apt install jenkins -y
Jenkins service was started and enabled:
sudo systemctl start jenkins
sudo systemctl enable jenkins
9.2 Jenkins Initial Setup
Jenkins was unlocked using the initial admin password
Suggested plugins were installed
An admin user was created
Security was enabled to restrict unauthorized access
10. Continuous Integration and Deployment Using Jenkins
10.1 Jenkins Setup
Jenkins was installed and configured on the AWS EC2 instance. Security was enabled by creating an
admin user and restricting anonymous access.
10.2 Jenkins Pipeline
A Jenkins pipeline was created to automate the following steps:
Source code checkout from GitHub
Docker image build
Container deployment on EC2
Sample Jenkins Pipeline:
pipeline {
agent any
stages {
stage('Build') {
steps {
sh 'docker build -t devops-node-app .'
stage('Deploy') {
steps {
sh 'docker run -d -p 3000:3000 devops-node-app'
10.3 Automated Trigger
A GitHub webhook was configured to trigger the Jenkins pipeline automatically on every code commit,
enabling real-time CI/CD.
11. Cloud Deployment on AWS EC2
The Dockerized application was deployed on an AWS EC2 instance running Ubuntu Linux. The
application was made accessible using the public IP address and port 3000.
This deployment demonstrated real-world cloud infrastructure usage and DevOps automation.
Server is running successfully on [Link]
12. Configuration Management Using Ansible
Ansible was used to automate basic server configuration tasks, such as ensuring Docker installation.
Ansible Playbook:
- hosts: localhost
become: true
tasks:
- name: Install Docker
apt:
name: [Link]
state: present
Ansible ensured consistent server configuration and reduced manual setup effort.
13. Monitoring Using Nagios
Nagios was introduced to monitor system health parameters such as CPU usage, memory utilization,
disk usage, and service availability. Monitoring represents the operations and feedback stage of the
DevOps lifecycle. Nagios is not functioning smoothly in a 1GB RAM server. So, screenshots were
unable to capture.
14. Conclusion
This project successfully demonstrates a complete DevOps CI/CD pipeline starting from local
development to cloud deployment. By integrating Git, Docker, Jenkins, AWS EC2, Ansible, and Nagios,
the project showcases automation, consistency, and operational awareness in modern software
delivery. The project highlights practical DevOps concepts including containerization, CI/CD, cloud
deployment, configuration management, and monitoring.
15. Future Enhancements
Integration of automated testing
Container orchestration using Kubernetes
Advanced monitoring and alerting
Rollback and disaster recovery mechanisms