Jenkins (I): Install Jenkins On Ubuntu 18.04/20.04

Jenkins: Install Jenkins On Ubuntu 18.04/20.04

Install Java

Jenkins requires java in order to run:

1
sudo apt install openjdk-11-jdk

Note: In current release, Jenkins only supports Java 8/11. For more information, check Java requirements

Install Jenkins LTS Release By apt

1
2
3
4
5
wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
sudo sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/ > \
/etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo apt-get install jenkins

Start Jenkins

1
sudo systemctl start jenkins

If Jenkins is up and running, you could see similar log at /var/log/jenkins/jenkins.log:

1
2020-09-15 20:14:14.384+0000 [id=21]	INFO	hudson.WebAppMain$3#run: Jenkins is fully up and running

Unlock Jenkins

Use browser to access http://<your-jenkins-ip>:8080:

Get the initialAdminPassword by sudo cat /var/lib/jenkins/secrets/initialAdminPassword, or find it in /var/log/jenkins/jenkins.log.