how to install jenkins on ubuntu



This content originally appeared on DEV Community and was authored by Sashi Kapoor

Step-1 Install Java

Update your system

Install java

sudo apt install openjdk-21-jre

java -version

It should look something like this after running the command

openjdk version “21.0.1” 2023-10-17

Step-2 Install Jenkins

The commands you provided are used to add the Jenkins repository and its GPG key to your system, specifically for Debian-based Linux distributions.

Add Jenkins GPG Key:

wget -q -O – https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add –

**

  1. Add Jenkins Repository to APT Sources:**

echo “deb http://pkg.jenkins.io/debian-stable binary/” | sudo tee -a /etc/apt/sources.list.d/jenkins.li

sudo apt-get update
sudo apt-get install jenkins

sudo systemctl enable jenkins
sudo systemctl start jenkins

sudo systemctl status jenkins

Open your web browser and enter the following URL in the address bar:

http://localhost:8080

Setup Jenkins

Set an Admin Password to use Jenkins: Copy the command below and paste it on a terminal and you will get your Admin Password.

/var/lib/jenkins/secrets/intialAdminPassword

** Install suggested plugins**

Image description

** Create a Username and Password**

Image description

Keep it running on the default URL

Image description


This content originally appeared on DEV Community and was authored by Sashi Kapoor