In modern DevOps workflows, automation is key—and that’s where Jenkins shines. It’s an open-source automation tool used to build, test, and deploy code continuously.
In this post, we’ll go through how to install Jenkins on an EC2 instance and trigger your first CI/CD job.
🚀 What is Jenkins?
Jenkins is a Java-based automation server widely used for:
- CI/CD pipelines
- Code testing & deployment
- Integration with Git, Docker, Kubernetes, etc.
🔧 Jenkins Installation on AWS EC2 (Ubuntu)
✅ Step 1: Launch EC2 Instance
Use your existing Ubuntu EC2 setup. Make sure port 8080 is allowed in the security group.
✅ Step 2: Install Java
sudo apt update
sudo apt install openjdk-11-jdk -y
✅ Step 3: Add Jenkins Repository & Install
wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
sudo sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/ > \
/etc/apt/sources.list.d/jenkins.list'
sudo apt update
sudo apt install jenkins -y
✅ Step 4: Start Jenkins
sudo systemctl enable jenkins
sudo systemctl start jenkins
🔑 Access Jenkins Dashboard
- Visit:
http://<your-ec2-public-ip>:8080
- Get the admin password:
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
- Paste it to unlock
- Install suggested plugins
- Create your admin user
🎉 You’re in!
🧪 Create Your First Jenkins Job
- Click New Item → Freestyle project
- Give it a name:
demo-build
- Under Source Code Management, select Git and add your repo
- Under Build, add:
echo "Running build job..."
- Click Save and then Build Now
✅ Jenkins will run the job and show you console output.
🧰 Use Cases of Jenkins in DevOps
- Run unit tests automatically on commits
- Deploy apps to servers or containers
- Build Docker images and push to ECR or Docker Hub
- Trigger pipelines using webhooks from GitHub/GitLab
🔗 Internal Links
🔗 External Links
🏁 Conclusion
Jenkins is the backbone of many DevOps pipelines. Once you set it up, you can automate almost everything—from code testing to production deployments.