Before installing Jenkins, ensure that you have the following prerequisites:
Add the Jenkins repository:
wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
Update your package list:
sudo apt-get update
Install Jenkins:
sudo apt-get install jenkins
Start Jenkins:
sudo systemctl start jenkins
Enable Jenkins to start at boot:
sudo systemctl enable jenkins
Open the firewall for Jenkins (if applicable):
sudo ufw allow 8080
sudo ufw reload
Once Jenkins is installed and running, you can access it by navigating to http://your_server_ip_or_domain:8080
in your web browser. The initial setup wizard will prompt you to unlock Jenkins using the password stored in /var/lib/jenkins/secrets/initialAdminPassword
.
Install Homebrew if you haven’t already:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Add the Jenkins repository:
brew install jenkins-lts
Start Jenkins:
brew services start jenkins-lts
Open the firewall for Jenkins (if applicable):
sudo pfctl -f /etc/pf.conf
sudo pfctl -e
After installing Jenkins, it is recommended to: