First of all we need to install java jdk and jre
1.sudo apt update
2.sudo apt install openjdk-8-jdk
3.sudo apt install openjdk-8-jre
Change our directory and install jenkins in that directory
4.cd /tmp && wget -q -O – https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add –
5.echo ‘deb https://pkg.jenkins.io/debian-stable binary/’ | sudo tee -a /etc/apt/sources.list.d/jenkins.list
6.sudo apt update
7.sudo apt install jenkins
To see whether the jenkins have been started or not
8.sudo systemctl start jenkins.service
9.sudo systemctl status jenkins.service
As jenkins runs on 8080 port so giving access to that port
10.sudo ufw allow 8080
11.sudo ufw status-: if status is inactive then execute following command “sudo ufw enable”
Go to the terminal and generate the password
- sudo cat /var/lib/jenkins/secrets/initialAdminPassword
password will be generated and copy paste it on web browser
13.http://localhost:8080
then enter above password
- Jenkins will be started successfully
To view/change admin password : sudo cat /var/lib/jenkins/secrets/initialAdminPassword