Install Jenkins on Debian

Update the packages:

sudo apt update -y
sudo apt upgrade -y
Jenkins is written in Java, so we need it:
sudo apt install openjdk-17-jdk default-jre gnupg2 apt-transport-https wget -y
Check whether Java is installed:
java -version
Add Jenkins GPG key and PPA
curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | sudo tee \
/usr/share/keyrings/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 
sudo apt update -y
Install Jenkins:
sudo apt-get install jenkins -y
Start and enable the Jenkins service
sudo systemctl enable jenkins --now
sudo systemctl status jenkins
Finish Jenkins Installation - navigate to http://x.x.x.x:8080, Jenkins is asking to be unlocked, the password is:
cat /var/lib/jenkins/secrets/initialAdminPassword
Install suggested plugins and create first Admin user then click on Save and Continue then Save and Finish.