Jenkins is an open-source automation server that facilitates the automation of various stages in the software development lifecycle, including building, testing, and deploying applications. It is widely recognized as a leading tool for implementing Continuous Integration (CI) and Continuous Delivery (CD) pipelines.
Jenkins helps development teams to integrate code changes frequently, automatically test them, and rapidly deliver high-quality software, thereby reducing integration issues and accelerating the release process.
Jenkins is a Java-based application, so a compatible Java Development Kit (JDK) is required. As of recent Jenkins versions, **OpenJDK 11 or OpenJDK 17** are recommended.
Open your terminal or command prompt and run:
java -version
If Java is installed, you'll see version information. If not, or if it's an incompatible version (e.g., Java 8), you need to install or update it.
sudo apt update
sudo apt install -y openjdk-17-jdk
sudo dnf install -y java-17-openjdk-devel
# Example for macOS with Homebrew, add to ~/.zshrc or ~/.bash_profile
export JAVA_HOME=$(/usr/libexec/java_home -v 17)
export PATH=$JAVA_HOME/bin:$PATH
# Then: source ~/.zshrc (or .bash_profile)
Jenkins can be installed in several ways. We'll cover direct OS installation and a popular containerized method.
This method uses the `apt` package manager for a system-wide installation.
sudo wget -O /usr/share/keyrings/jenkins-keyring.asc \
https://pkg.jenkins.io/debian-stable/jenkins-keyring.asc
echo "deb [signed-by=/usr/share/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 -y jenkins
Jenkins should start automatically after installation.
sudo systemctl start jenkins
sudo systemctl status jenkins
# Expected output will show 'active (running)'
sudo ufw allow 8080 # Jenkins default port
sudo ufw enable # Enable firewall if it's not already
sudo ufw status # Verify the rule is active
Jenkins will be accessible at `http://
This method uses the `dnf` package manager (or `yum` for older CentOS/RHEL versions).
sudo wget -O /etc/yum.repos.d/jenkins.repo \
https://pkg.jenkins.io/redhat-stable/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io-2023.key
sudo dnf install -y jenkins # Use 'sudo yum install -y jenkins' for older systems
sudo systemctl start jenkins
sudo systemctl enable jenkins
sudo systemctl status jenkins
# Expected output will show 'active (running)'
sudo firewall-cmd --permanent --zone=public --add-port=8080/tcp # Allow HTTP access
sudo firewall-cmd --reload # Apply changes
Jenkins will be accessible at `http://
Jenkins provides a native Windows installer (MSI).
Go to the official Jenkins website: jenkins.io/download/lts/windows/ and download the LTS installer.
Jenkins should start automatically after installation. You can access it at `http://localhost:8080` (or your chosen port).
You can also manage the Jenkins service via `services.msc` (search in Windows Start Menu).
The recommended way to install Jenkins on macOS is using Homebrew.
Open Terminal.app (Finder > Applications > Utilities > Terminal) and run:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Follow the on-screen instructions to complete the Homebrew installation.
brew install jenkins-lts
# Start Jenkins (will launch automatically on login)
brew services start jenkins-lts
# Check status
brew services list # Look for jenkins-lts status
Jenkins will be accessible at `http://localhost:8080`.
Note: macOS Gatekeeper might initially block Jenkins. If prompted, go to System Settings > Privacy & Security > General and click "Open Anyway" for Jenkins.
After Jenkins starts for the first time, you'll be redirected to a web-based setup wizard in your browser (at `http://
The first screen will ask for an administrator password. Retrieve it from your server's initial admin password file:
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
type "C:\Program Files\Jenkins\secrets\initialAdminPassword"
cat /Users/Shared/Jenkins/Home/secrets/initialAdminPassword
docker logs <jenkins_container_id_or_name> # Look for the password in the logs
Paste the password into the browser field and click **Continue**.
Jenkins will proceed to download and install the selected plugins. This might take several minutes.
Once plugins are installed, you'll be prompted to create your first administrator user. Fill in all the fields (Username, Password, Full Name, Email Address). **Remember these credentials!**
Confirm your Jenkins URL. The default (`http://localhost:8080`) is usually fine for local setups. For servers, ensure it's your server's public IP or hostname. Click **Save and Finish**.
You'll now be redirected to the Jenkins dashboard. Your Jenkins instance is ready!
Depending on your projects, you'll need build tools (Maven, Gradle, npm), SCM clients (Git), etc., on your Jenkins server or agents.
# Ubuntu/Debian
sudo apt install -y git
# Red Hat/CentOS/Fedora
sudo dnf install -y git
Jenkins Dashboard > Manage Jenkins > Tools
Jenkins' power comes from its plugins. Explore the marketplace for plugins relevant to your workflow.
Jenkins Dashboard > Manage Jenkins > Plugins
For production environments, enhance security beyond the initial setup:
# Linux:
sudo journalctl -u jenkins.service
sudo cat /var/log/jenkins/jenkins.log
# Windows:
Check Event Viewer > Windows Logs > Application. Also check Jenkins installation folder for logs.
Installing Jenkins is the first step towards automating your software delivery pipelines. While the initial setup might seem daunting, mastering Jenkins will significantly improve your team's efficiency and ability to deliver high-quality software faster. Keep experimenting with different job types, plugins, and integrations to unlock its full potential!