Important: Jenkins requires a compatible version of Java. Ensure you have Java 17 installed on your system before proceeding with the steps below.
Open your terminal and ensure your package list is updated and upgrades are applied:
sudo apt update
sudo apt upgrade -y
Download and add the GPG key for the Jenkins repository:
sudo wget -O /etc/apt/keyrings/jenkins-keyring.asc \\
<https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key>
Add the Jenkins stable repository to your system's software sources:
echo "deb [signed-by=/etc/apt/keyrings/jenkins-keyring.asc]" \\
<https://pkg.jenkins.io/debian-stable> binary/ | sudo tee \\
/etc/apt/sources.list.d/jenkins.list > /dev/null
Update your package list again to include the Jenkins repository, then install Jenkins:
sudo apt update
sudo apt install jenkins -y