Jenkins is an open-source automation server that offers an easy way to set up a continuous integration and continuous delivery (CI/CD) pipeline.

Continuous integration (CI) is a DevOps practice in which team members regularly commit their code changes to the version control repository, after which automated builds and tests are run. Continuous delivery (CD) is a series of practices where code changes are automatically built, tested, and deployed to production.

In this tutorial, we will cover how to install Jenkins on a Debian 10, Buster from the official Jenkins repository.

Installing Jenkins

Perform the following steps as root or user with sudo privileges to install Jenkins on Debian 10:

  1. Jenkins is written in Java, so the first step is to install Java. To do so, update the package index and install the OpenJDK 11 package with the following commands:
    sudo apt updatesudo apt install default-jdk

    Java LTS version 8 is not available in the official Debian Buster repositories. If you want to run Jenkins with Java 8, check this installation guide.

  2. Use wget to download and import the Jenkins repository GPG keys:
    wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -

    The command should return OK, which means that the key has been successfully imported, and the packages from this repository will be considered trusted.

    Run the following command to add the Jenkins repository to your system:

    sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
  3. Update the apt package list and install the latest version of Jenkins:
    sudo apt updatesudo apt install jenkins
  4. Enable and start the Jenkins service by executing:
    sudo systemctl enable --now jenkins

Setting Up Jenkins

To start the setup process, open your browser and type your domain or IP address, followed by port 8080, http://your_ip_or_domain:8080.

A screen similar to the following will be displayed:

During the installation, the Jenkins installer creates an initial 32-character long alphanumeric password. To find the password type:

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

Copy the password, paste it into the Administrator password field, and click Continue.

On the next screen, the setup wizard will ask you whether you want to install suggested plugins or you want to select specific plugins. Click on the Install suggested plugins box, and the installation process will start immediately.

Next, you will be prompted to set up the first admin user. Fill out the required information and click Save and Continue.

The next page will ask you to set the URL for your Jenkins instance. The field will be populated with an automatically generated URL.

Confirm the URL by clicking on the Save and Finish button, and the setup process will be completed.

Click on the Start using Jenkins button, and you will be redirected to the Jenkins dashboard logged in as the admin user you have created in one of the previous steps.

At this point, you’ve successfully installed Jenkins on your system.

Conclusion

In this tutorial, you have learned how to install and complete the initial configuration of Jenkins on Debian systems. You can now visit the official Jenkins documentation page and start exploring Jenkins’s workflow and plug-in model.

If you have any questions, please leave a comment below.