Skip to content
Related Articles

Related Articles

How to Install and configure Jenkins on Debian Linux (Ubuntu/Kali/Mint)

View Discussion
Improve Article
Save Article
  • Last Updated : 11 Jul, 2022
View Discussion
Improve Article
Save Article

Jenkins is an open-source, cross-platform automation server that is used to build, test and deploy software. It simplifies and accelerates Continuous Integration/Continuous Delivery (CI/CD) environments by creating jobs, scripts, and pipelines. The application is primarily written in Java and requires a specific version of the Java Runtime Environment (JRE). Jenkins can be used to build and deploy software written in almost any modern programming language and framework. Furthermore, it integrates easily with third-party applications such as GitHub, Puppet, Docker, etc.

This tutorial will discuss how to install and configure Jenkins on Ubuntu or any Debian-based distro.

Installation of Jenkins

Step 1: Update and upgrade  your system by running

$ sudo apt update

$ sudo apt upgrade

 

 

 

Step 2: Now import GPG keys to your system

$ curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo tee \

 /usr/share/keyrings/jenkins-keyring.asc > /dev/null

 

Step 3: Add the Jenkins repository to the sources list once the GPG key has been imported.

$ echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \

 https://pkg.jenkins.io/debian-stable binary/ | sudo tee \

 /etc/apt/sources.list.d/jenkins.list > /dev/null

 

Step 4: Once again update your system.

$ sudo apt update

 

Step 5: Finally, install Jenkins by running the following command. 

$ sudo apt install jenkins

 

Step 6: Now, start the Jenkins server by using systemctl command.

$ sudo systemctl start jenkins

$ sudo systemctl status jenkins

 

Step 7: Now enable the system firewall and open port 8080 to access the Jenkins server.

$ sudo ufw enable

$ sudo ufw allow 8080

 

Step 8: Verify the changes by running

$ sudo ufw status

 

Step 9: Start configuring Jenkins by navigating to http://localhost:8080 or  https://your-server-ip-address:8080. Unlock the admin privileges by entering the default password created during the installation.

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

 

 

Step 10: Create a new account by entering a username, password, and email address.

 

Step 11: Select Install suggested plugins and wait till all the plugins are successfully downloaded and installed on your machine.

 

 

 

Step 12: At this point, Jenkins has been successfully installed and configured on your Debian machine.

 

 

Uninstallation of Jenkins

To uninstall Jenkins and all of its config files run

$ sudo apt remove jenkins
My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!