Installing Jenkins on Ubuntu

For example, I will install Jenkins on Ubuntu 20.04

Let’s add a key to the system:

curl -fsSL | sudo tee \
    /usr/share/keyrings/jenkins-keyring.asc > /dev/null

Let’s add the Jenkins repository:

echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \ binary/ | sudo tee \
    /etc/apt/sources.list.d/jenkins.list > /dev/null
sudo apt-get update

Install Jenkins from the added repository:

sudo apt-get install fontconfig openjdk-11-jre
sudo apt-get install jenkins

After installation, some options will be in /etc/default/jenkins.

Check if the process is running:

sudo systemctl status jenkins
sudo systemctl restart jenkins

Open the web interface, for example

Let’s see the generated password for the admin user:

sudo cat /var/lib/jenkins/secrets/initialAdminPassword

Next, select “Install suggested plugins”, in the next step, create a new user or keep the existing “admin”.

Leave a comment

Leave a Reply