How to install Jenkins on Linux?

First published: Tuesday, January 23, 2024 | Last updated: Tuesday, January 23, 2024

Know simple steps to install Jenkins on Linux-based operating systems to manage CI/CD pipeline workflows.


What is Jenkins?

Jenkins is an open source automation server written in Java. With Jenkins, organizations can accelerate the software development process by automating it. Jenkins manages and controls software delivery processes throughout the entire software development lifecycle, including build, document, test, package, stage, deployment, static code analysis and much more.

Install Jenkins

Before setting up a new Jenkins server, it is crucial to conduct a thorough check for any existing Jenkins installations. This article is dedicated to providing detailed guidance on installing Jenkins. It is highly recommended that a package manager be utilized to install Jenkins on Linux-based operating systems. Upon the completion of the installation, it is imperative to verify the Jenkins version to ensure that the installation was successful. For more in-depth information, please refer to the Jenkins documentation.

Linux (RPM)

You can use the following commands to install Jenkins in RPM-based Linux operating systems such as CentOS LinuxRed Hat LinuxFedora LinuxAmazon LinuxAlma LinuxRocky Linux, etc., or any other similar equivalents.

# Add Jenkins repository to package manager source list.
$ sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo

# Add Jenkins official GPG key to package manager.
$ sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io-2023.key

# Install Open JDK and dependencies.
$ sudo yum install fontconfig java-17-openjdk

# Install Jenkins.
$ sudo yum install jenkins

# Enable Jenkins service at boot.
$ sudo systemctl enable jenkins.service

Linux (Debian)

You can use the following commands to install Jenkins in Debian-based Linux operating systems such as Ubuntu LinuxMint LinuxKali LinuxKubuntu Linux, etc., or any other similar equivalents.

# Download init system helpers.
$ wget http://ftp.kr.debian.org/debian/pool/main/i/init-system-helpers/init-system-helpers_1.60_all.deb -P /tmp
 
# Install init system helpers.
$ sudo apt install /tmp/init-system-helpers_1.60_all.deb

# Add Jenkins official GPG key to package manager.
$ sudo wget -O /usr/share/keyrings/jenkins-keyring.asc https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key

# Add Jenkins repository to package manager source list.
$ 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

# Check for package updates.
$ sudo apt update

# Install Open JDK and dependencies.
$ sudo apt install fontconfig openjdk-17-jre

# Install Jenkins.
$ sudo apt install jenkins

# Enable Jenkins service at boot.
$ sudo systemctl enable jenkins.service

Logo of SloopStash organization.

Interested in our products, open source works, training, or solutions?

Just send us a message, we're here to support you. Feel free to reach out anytime for assistance.


Contact us