Jenkins setup –
Jenkins overview :
Jenkins is a free and open-source automation server. IT helps automate the parts of software development related to building, testing and deploying facilitating continuous integration and continuous delivery.
How Jenkins Works:
Jenkins runs as a server on a variety of platforms including Linux, Windows, Mascos, unix variants. It requires a Java 8 vm and can be run on the oracle JRE or open JDK. Jenkins runs as a Java servlet within a jetty application server.
![](https://devopslover.com/wp-content/uploads/2023/07/image-15.png)
Jenkins History:
The Jenkins project was started in 2004 (originally called Hudson) by kohsuke kawaguchi, while he worked for sun microsystem.
Kohsuke was a developer at sun and got tired of incurring the wrath of his team every time his code broke the build.
Features of Jenkins:
- Continuous integration and continuous delivery
- Easy installation
- Plugins
- Extensible
- Distributed
- Easy configuration
The pre-requisites for the installation of Jenkins.
1.Hardware Requirements
Resource Requirement
RAM 256 MB
Drive Space 1 GB (10 GB if Jenkins is running as a Docker container)
Resource Requirement RAM 1 GB
Drive Space 50 GB
Still, the call out is that these requirements will be different for each team depending on the team’s size, the parallel users of Jenkins, and the number of jobs running on the Jenkins server.
2.Software Requirements
The below table lists the minimum software requirements, which need to be present on a machine on which we are planning to install the Jenkins:
JAVA Java Development Kit (JDK) or Java Runtime Environment (JRE).
Web Browser Any of the browsers such as Google Chrome, Mozilla Firefox, Microsoft Internet Explorer, Microsoft Edge, Safari
Operating System
Jenkins supports almost all the modern operating systems such as Windows, macOS, Linux flavors such as Red Hat, Ubuntu, OpenSUSE, Gentoo, etc.
JENKINS INSTALLATION STEPS:
IMPORTANT: Make sure to remove any older installations before installing a new one.
Firstly check java is install or not, if java is not install then install the java version and then jenkins.
Step 1: To check java version
$java –version
![Jenkins setup](https://devopslover.com/wp-content/uploads/2023/07/image-17.png)
Step 2:
$sudo snap install curl
Step 3:
$curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo tee
/usr/share/keyrings/jenkins-keyring.asc > /dev/null
Step 4:
$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 5:
$sudo apt update
Step 6:
$sudo apt install jenkins -y
![Jenkins setup](https://devopslover.com/wp-content/uploads/2023/07/image-18.png)
$sudo systemctl status jenkins
![](https://devopslover.com/wp-content/uploads/2023/07/image-19.png)
$sudo systemctl enable –now jenkins
![](https://devopslover.com/wp-content/uploads/2023/07/image-20.png)
if next step is not available then press ctrl+z
$sudo ufw allow 8080 $sudo ufw status $sudo ufw enable $sudo ufw status
![](https://devopslover.com/wp-content/uploads/2023/07/image-21.png)
Step 7:
open the browzer
http://localhost:8080
![](https://devopslover.com/wp-content/uploads/2023/07/image-22.png)
Step 8:
Open the terminal
$ sudo cat varlib/jenkins/secrets/initialAdminPassword
![](https://devopslover.com/wp-content/uploads/2023/07/image-23.png)
Copy that password and paste it on Administrator Password.
![](https://devopslover.com/wp-content/uploads/2023/07/image-24.png)
Step 9:
As soon as you click on the Continue button, you will be redirected to the page to suggest you install suggested plugins. After that, click on “Install suggested plugins”. Kindly note that if users want to install only selected plugins required, it is recommended to select the option ” Select plugins to install”.
![](https://devopslover.com/wp-content/uploads/2023/07/image-25.png)
Step 10:
After clicking on the suggested plugin button, the standard plugin installation will be started automatically, as displayed in the below screen:
![](https://devopslover.com/wp-content/uploads/2023/07/image-26.png)
Step 11:
Finally, after installation of all suggested plugins, you will be redirected to the User Account Page like below:
![](https://devopslover.com/wp-content/uploads/2023/07/image-27.png)
step 12:
Here we need to do the following things:
- Put username, new password that you want to put.
- Put confirm password, full name, email address, and click on the “Save and Continue”
button.
- You can choose the option “Skip and continue as Admin” located beside the “Save and Continue” button, and in this case, you need to put the same password that you put in the previous steps. It is always recommended that you need to put in a new password according
to your choice.
![](https://devopslover.com/wp-content/uploads/2023/07/image-28.png)
Step 13:
After clicking, you will be redirected to a new screen that will display a message like
“Jenkins is Ready”. Now click on the “Start using Jenkins” button.
![](https://devopslover.com/wp-content/uploads/2023/07/image-29.png)
step 14:
After clicking on the “Start using Jenkins ” button, you will be redirected to the Jenkins Dashboard.
![](https://devopslover.com/wp-content/uploads/2023/07/image-30.png)
Here is the jenkins setup complete.
Hope you like this blog….
- Sending slack notification via pipeline job - August 25, 2024
- SonarQube integration with Jenkins - August 24, 2024
- Deployment of 2 application java and python using k8s : slack alerting Using Jenkins pipeline liberary - August 10, 2024