DEV Community

Sashi Kapoor
Sashi Kapoor

Posted on

how to install jenkins on ubuntu

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:
Enter fullscreen mode Exit fullscreen mode

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.
Enter fullscreen mode Exit fullscreen mode

/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

Top comments (0)