This article demonstrates how to install the Jenkins server in Ubuntu 20.04.
Install JDK
First, the JDK needs to be installed, in this article, we choose to install openjdk 11.
1 | sudo apt-get install openjdk-11-jdk |
After the installation is completed, we can execute the following command to confirm that the installation was successful.
1 | java -version |
If successful, the system displays the following information:
1 | openjdk version "11.0.13" 2021-10-19 |
Install Jenkins
We will use the Jenkins APT repository, import the source GPGkey, and install the Jenkins package.
1 | wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add - |
To add a software source to the system:
1 | sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list' |
Upgrade the apt package list
1 | sudo apt update |
Install jenkins
1 | sudo apt install jenkins |
After the installation is completed, we can use the ‘systemctl status’ to check the status of service running
1 | sudo systemctl status jenkins |
The system displays information similar to the following
1 | ● jenkins.service - LSB: Start Jenkins at boot time |
The above steps complete the installation of jenkins. How to configue the jenkins can refer to other articles.
The initial password is stored in /var/lib/jenkins/secrets/initialAdminPassword.
Log file is /var/log/jenkins/jenkins.log.