How to Install Jenkins on Elementary OS Latest

Jenkins is a popular open-source automation server that helps to automate different tasks at different stages of software development. In this tutorial, we will learn how to install Jenkins on the Elementary OS latest version.

Prerequisites

Before we start, make sure that your system is up-to-date with the latest release packages. You can update the system with the following command:

sudo apt-get update && sudo apt-get upgrade -y

Step 1 — Installing Java

Jenkins requires Java to run on the system. The first step is to install the latest version of Java.

Run the following command to install the JDK 8 version:

sudo apt-get install openjdk-8-jre

After the installation completes, verify the installation by checking the version of Java:

java -version

The output should be similar to the following:

openjdk version "1.8.0_242"
OpenJDK Runtime Environment (build 1.8.0_242-b08)
OpenJDK 64-Bit Server VM (build 25.242-b08, mixed mode)

Step 2 — Adding Jenkins Repository

By default, Jenkins is not available in the official Elementary OS package repository. We need to add the Jenkins repository to the system before installing Jenkins.

To add the Jenkins repository, follow these steps:

  1. Import the repository key:

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

  2. Add the Jenkins repository to the package repository list:

    echo deb https://pkg.jenkins.io/debian-stable binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list

Step 3 — Installing Jenkins

Now that we have added the Jenkins package repository to the system, we can install Jenkins.

Run the following command to update the system package list and install Jenkins:

sudo apt-get update && sudo apt-get install jenkins

Once the installation is complete, start the Jenkins service:

sudo systemctl start jenkins

Step 4 — Accessing Jenkins Web Interface

Jenkins runs on port 8080 by default. To access the Jenkins web interface, open a web browser and go to the following URL:

http://<your-server-IP-address>:8080

If you are accessing the web interface on the same machine, simply open a web browser and navigate to http://localhost:8080.

On the initial screen, you will be asked to enter the initial admin password, which is located in the following file:

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

Copy the password and paste it into the password field.

You should now see the Jenkins web interface.

Conclusion

In this tutorial, we have successfully installed Jenkins on the Elementary OS latest version. You can now use Jenkins to automate various tasks and processes in your software development workflow.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!