Saturday, December 28, 2024
Google search engine
HomeGuest BlogsHow to Install Jenkins on Debian 10 (Buster)

How to Install Jenkins on Debian 10 (Buster)

Introduction

Jenkins is used by software developers to automate different aspects of building, testing, delivering, and deploying software applications. It is a crucial tool for facilitating the software development process.

This guide will help you install Jenkins on Debian 10 Linux (codename Buster).

tutorial on installing jenkins on debian 10tutorial on installing jenkins on debian 10

Prerequisites

  • A Linux system with Debian 10 installed
  • A user account with sudo or root privileges
  • Access to a terminal window / command line (Activities > Search > Terminal)

Step For Installing Jenkins on Debian 10

Jenkins requires Java to run. The latest versions of Jenkins support the Java 11 runtime environment, which is available in the official Debian 10 repositories. However, there may still be outstanding bugs with some Jenkins plugins and Java 11. This tutorial helps you install Java JDK 11.

Jenkins can also run under the Java 8 runtime environment, which may be more stable for certain plugins. If you already have Java 8 installed, you may choose to use it instead of installing Java 11.

Note: If you plan on upgrading from Java 8 to Java 11, this can create conflicts in Jenkins. You should either install Java 11 before installing Jenkins or review these installation notes before the upgrade.

Step 1: Install Java 11

Start by installing the Java 11 developer’s kit. The JDK, or Java Developer’s Kit, includes all the files for the JRE, or Java Runtime Environment.

1. Open a terminal window and update the package repository with the command:

sudo apt-get update

2. Now you can install Java by running:

sudo apt-get install default-jdk

The system tells you the size of the download and prompts you to confirm the installation.

3. Type y and hit Enter.

Step 2: Download the GPG Security Key

It’s always wise to authenticate software that you download. Add the Jenkins GPG security keys by entering the following:

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

The system should respond with OK.

Adding the Jenkins GPG security keysAdding the Jenkins GPG security keys

Step 3: Add the Jenkins Repository to Your System

By default, Debian 10 doesn’t include access to the Jenkins software repository. You can add it by entering the following command:

sudo sh –c ‘echo deb https://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list’

This command adds the repository for the LTS (Long-Term Support) version of Jenkins. LTS versions are considered more stable and reliable than the weekly release. The latest software may have bugs or glitches that can disrupt a production environment.

If you’d rather use a weekly release of Jenkins, use the following command instead:

sudo sh -c 'echo deb https://pkg.jenkins.io/debian binary/ > /etc/apt/sources.list.d/jenkins.list'

Step 4: Install Jenkins

Before you install Jenkins, update the local repository:

sudo apt-get update

2. Then, run the command:

sudo apt-get install jenkins

The system displays the amount of storage space required, then prompts you to confirm the installation.

Command to install Jenkins on Debian 10.Command to install Jenkins on Debian 10.

3. Type y and hit Enter.

Note: If you have servers running other operating systems, you can install Jenkins on Ubuntu or install Jenkins on CentOS 8.

Step 5: Start and Enable the Jenkins Service

Once the installation has finished, start the Jenkins service by entering the following:

sudo systemctl start jenkins

Then, configure Jenkins to start when the system boots:

sudo systemctl enable jenkins

Step 6: Configure Jenkins

Access the Jenkins configuration utility by opening a web browser to the following address:

http://localhost:8080
unlocking jenkins on debian 10unlocking jenkins on debian 10

If your server has a domain or hostname, use that instead of localhost.

Note: The 7 DevOps principles behind Jenkins relate to the concepts behind Kubernetes. You may also be interested in deploying Jenkins on Kubernetes.

Unlock Jenkins

On the Jenkins configuration webpage, you’ll see a notification that a password was created during  installation. To view the password, switch to a terminal window and enter the following:

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

The system displays a long alphanumeric code. Use your mouse to highlight the code, right-click > copy.

code example to unlock jenkinscode example to unlock jenkins

Switch to the Jenkins Getting Started page, and right-click > paste the code into the Administrator Password field. Then, click Continue.

entering Jenkins admin passwordentering Jenkins admin password

Install Plugins

On the next screen, you are asked to either:

Install suggested plugins

or

Select plugins to install

You can always change your plugins later. Unless you know which plugins you specifically want, click Install suggested plugins.

Create First Admin User

Once plugins are finished installing, you’ll be asked to Create First Admin User.

The form is self-explanatory. Fill in the fields with the required information and click Save and Continue.

Create first admin user in Jenkins formCreate first admin user in Jenkins form

Instance Configuration

The last screen displays the Jenkins URL. This should be the same URL you used in the beginning to access the configuration tool.

You can use this URL anytime to set up Jenkins. When you’re ready, click Save and Finish.

The system lets you know that Jenkins is ready! Click Start using Jenkins to load the Jenkins software.

You’ll be taken to the main Jenkins dashboard, with a Welcome to Jenkins! message at the bottom of the page.

Jenkins dashboard welcome screenJenkins dashboard welcome screen

Note: Visit our Jenkins beginner’s tutorial to learn all about Jenkins’ features.

Conclusion

You should now have Jenkins installed and ready to use on your Debian 10. You can now easily coordinate with multiple teams on a project and deliver software in a CI/CD environment.

If you are using a different distribution of Linux, we also have a guide on how to install Jenkins od CentOS, and how to install Jenkins on Ubuntu. For Windows users, check out our guide on how to install Jenkins on Windows and if you are a Mac user, learn how to install Jenkins on Mac.

To learn more on how to use Jenkins, check out our guide on list, create and use Jenkins environment variables.

Was this article helpful?
YesNo

RELATED ARTICLES

Most Popular

Recent Comments