How to Install Jenkins in Ubuntu

How to Install Jenkins in Ubuntu

Part of DevOps

Step by Step instructions:

New to GRE Registration? A step-by-step Guide to ETS GRE Registration

Step 1:

 sudo apt-get update

When you run the sudo apt-get update command, the system will check for any updates available and update the package lists accordingly. This ensures that the system has the latest software and security updates.

Step 2:

sudo apt install openjdk-11-jre

When you enter the command sudo apt-get install openjdk-11-jdk in the terminal, the package manager apt-get will download and install the OpenJDK 11 JDK on your Linux system.

java -version

Step 3:

curl -fsSL https://pkg.jenkins.io/debian/jenkins.io-2023.key | sudo tee \
  /usr/share/keyrings/jenkins-keyring.asc > /dev/null
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
  https://pkg.jenkins.io/debian binary/ | sudo tee \
  /etc/apt/sources.list.d/jenkins.list > /dev/null

These two commands download the Jenkins package repository key, store it in a keyring file, and add the repository to the system's list of software sources so that the Jenkins package can be installed or updated via the package manager (apt-get).

Step 4:

sudo apt-get update

Step 5:

sudo apt-get install jenkins

When you enter the command sudo apt-get install jenkins in the terminal, the package manager apt-get will download and install the Jenkins software package on your Linux system. Once installed, you can access Jenkins in your web browser at http://localhost:8080 to start configuring and using it for your software development needs.

If you reached until this step that means you have successfully installed Jenkins on your OS.


After Installation:

Enable/Start your Jenkins Service and check the status

sudo systemctl start jenkins.service
sudo systemctl status jenkins

Access your Jenkins by using the below URL

URL: https://<localhost>:8080

Note: Replace localhost with your instance Public IP. In my case its 3.95.136.77.

You will land here once you hit the URL:

To get the Admin Password use the below command:

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

copy the output and paste it in password section and hit Continue.

You will land here:

Click on Install suggested plugins

Once everything is becomes Green

Give the details and hit Save and Continue.

Jenkins is Ready Machi....

Dashboard looks like this:


Thank you for reading my Blog. I hope you have learnt something from it! If you find this blog helpful, please like, share, and follow me for more interesting posts like this in the future.

Pavan Kumar R

LinkedIn Link