This article demonstrates how to install the Jenkins server in Ubuntu 20.04.
First, the JDK needs to be installed, in this article, we choose to install openjdk 11.
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.
If successful, the system displays the following information:
openjdk version "11.0.13" 2021-10-19
We will use the Jenkins APT repository, import the source GPGkey, and install the Jenkins package.
wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
To add a software source to the system:
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
Upgrade the apt package list
sudo apt update
sudo apt install jenkins
After the installation is completed, we can use the ‘systemctl status’ to check the status of service running
sudo systemctl status jenkins
The system displays information similar to the following
● 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.