Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Take A QuizChallenge yourself and boost your learning! Start the quiz now to earn credits.
Take A QuizUnlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
Take A Quiz
🔐 Introduction
Now that you understand what Jenkins is and why it’s vital
in modern CI/CD workflows, it’s time to install and configure Jenkins to
begin your automation journey. Whether you're setting it up on a local machine
for testing or on a production server for real-world projects, this chapter
provides a step-by-step guide to getting Jenkins up and running —
securely and efficiently.
💡 What You’ll Learn in
This Chapter
🛠️ Prerequisites
Requirement |
Details |
Java (JDK 11 or
higher) |
Required to run
Jenkins |
Minimum RAM |
2 GB
(recommended 4 GB) |
Disk Space |
Minimum 1 GB (for
Jenkins and build artifacts) |
Internet Access |
For
downloading plugins and dependencies |
Browser |
Latest version of
Chrome, Firefox, or Edge |
⚙️ 1. Installing Jenkins
✅ Method 1: Jenkins WAR File
(Portable & Quick)
bash
java
-jar jenkins.war
Best for: Quick testing, local development
✅ Method 2: Install Jenkins on
Ubuntu/Debian
bash
#
Add Jenkins repo
wget
-q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
sudo
sh -c 'echo deb https://pkg.jenkins.io/debian binary/ >
/etc/apt/sources.list.d/jenkins.list'
#
Update & install
sudo
apt update
sudo
apt install jenkins
Then start Jenkins:
bash
sudo
systemctl start jenkins
sudo
systemctl enable jenkins
Visit Jenkins at: http://<your-server-ip>:8080
✅ Method 3: Install Jenkins Using
Docker
bash
docker
run -d -p 8080:8080 -p 50000:50000 --name jenkins \
-v jenkins_home:/var/jenkins_home \
jenkins/jenkins:lts
Use docker exec -it jenkins cat
/var/jenkins_home/secrets/initialAdminPassword to get the admin password.
Best for: Isolated setup, easy teardown,
cross-platform use
✅ Method 4: Cloud Setup
(Optional)
You can deploy Jenkins on cloud services like:
Cloud setups allow remote access, scalability, and
integration with cloud DevOps pipelines.
🔑 2. Jenkins First-Time
Setup
Once installed:
🔌 Recommended Plugins to
Install
Plugin Name |
Purpose |
Git Plugin |
Pull code from GitHub,
GitLab, Bitbucket |
Pipeline Plugin |
Enable scripted/declarative
CI/CD workflows |
Docker Pipeline |
Run CI/CD tasks in
Docker containers |
Blue Ocean |
Modern
pipeline UI with visual stages |
Email Extension |
Send alerts for build
success/failure |
Credentials Binding |
Manage
secrets securely in builds |
🔧 3. Configuring Jenkins
System Settings
Navigate to:
Manage Jenkins → Configure System
⚙️ Key Configurations:
🛡️ 4. Securing Jenkins
Security is critical in any automation setup. Jenkins offers
several options to protect credentials and jobs.
Security Feature |
How to Enable |
User authentication |
Use Jenkins’ own
database or integrate with GitHub OAuth |
Role-based access control |
Use Role
Strategy Plugin for fine-grained permissions |
Disable CLI
remoting |
Reduce remote attack
surface |
Secret masking |
Hide passwords/API
keys in logs |
HTTPS configuration |
Use reverse proxy with
SSL termination (e.g., NGINX) |
🔐 Credentials Management
Store sensitive information like:
Manage from:
Manage Jenkins → Credentials
Use Credential IDs in pipelines to inject them
securely.
🧪 5. Verifying Jenkins
Installation
Once installed and configured:
You should see:
pgsql
Started by user admin
Building on master
Hello, Jenkins!
Finished: SUCCESS
Congratulations, your Jenkins setup works!
🧘 6. Troubleshooting
Common Issues
Issue |
Solution |
Port 8080 already
in use |
Change Jenkins port in
jenkins.xml or Docker run command |
Cannot access Jenkins UI |
Check
firewall, proxy, or server IP address |
Plugin installation
stuck |
Restart Jenkins or use
“Advanced” tab to upload manually |
Build workspace not cleaned |
Enable
workspace cleanup post-build |
Credentials not
available in pipeline |
Ensure correct scope
and ID used |
🧠 Tips for Beginners
📘 Summary
Installing and configuring Jenkins might seem like a lot at
first, but it’s surprisingly manageable when broken down into simple steps.
Whether you're experimenting locally, using Docker for containers, or setting
up in the cloud — Jenkins gives you a solid foundation for automation.
With the right plugins, security configurations, and a few
test jobs, you’ll be ready to start automating your entire software pipeline.
Jenkins isn’t just an automation server — it’s your DevOps
launchpad.
Jenkins is an open-source automation server that helps developers automate building, testing, and deploying code. It enables Continuous Integration and Continuous Delivery (CI/CD), making software delivery faster and more reliable.
To install Jenkins, you need:
The simplest way is to use the Jenkins WAR file:
java -jar jenkins.war
Alternatively, you can use a Docker container for a quick and clean setup:
docker
run -p 8080:8080 jenkins/jenkins:lts
Install the Git and GitHub plugins, then:
A pipeline is a script-based workflow written in Groovy DSL that defines your automation steps (e.g., build, test, deploy). Pipelines can be declarative (simplified) or scripted (flexible).
For basic automation, start with:
Yes! Jenkins integrates with Docker for building images and with Kubernetes for scaling jobs using agents. Tools like Jenkins X also help automate deployments in Kubernetes.
You can:
Yes! Jenkins is 100% free and open-source, licensed under MIT. You can use it in personal, educational, and commercial environments without restriction.
Please log in to access this content. You will be redirected to the login page shortly.
LoginReady to take your education and career to the next level? Register today and join our growing community of learners and professionals.
Comments(0)