Jenkins is an open source automation server. which help to automate the non human part of software development process with continuous integration, continuous delivery and continuous deployment. It a server based system, which runs servlet container such as apache tomcat.
 |
| Jenkins - Installation of Jenkins |
1. Overview
Jenkins is an open-source automation tool developed by sun microsystem and written in Java. Initial released date was 2nd february 2011. Jenkins offers continuous integration with continuous delivery and continuous deployment pipeline. Jenkins setup is also breeze due to java based construction. It is ready to play right out of the box & works well with windows, Mac OS X, Linux and Ubuntu.
In this tutorial we will walk you through steps of installing Jenkins on a Linux operating system.
2. Hardware Requirements
- We need minimum 256 mb of RAM in order to install Jenkins on computer.
- 1 GB hard drive space
3. Software Requirements
Since Jenkins developed by sun microsystem and written in Java. We have to make sure about that Java is Installed in our system. In order to see whether Java is installed or not, we can say from terminal or command prompt -
java -version
openjdk version "12.0.1" 2019-04-16
OpenJDK Runtime Environment (build 12.0.1+12)
OpenJDK 64-Bit Server VM
If it is not yet installed then -
# install java 1.8 on Amazon Linux
sudo yum update -y
sudo yum install -y java-1.8.0-openjdk-devel
sudo alternatives --config java
4. Install Jenkins on Linux Operating System
For installation of Jenkins on linux operating system please follow up the below steps -
# install Jenkins on Amazon Linux
sudo wget -O /etc/yum.repos.d/jenkins.repo
http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo
sudo rpm --import
http://pkg.jenkins-ci.org/redhat-stable/jenkins-ci.org.key
sudo yum install jenkins
If you are installing Jenkins in Amazon Cloud server, while connecting to EC2 server make sure you have followed the below steps, or else you won't be able to connect -
# ssh into EC2 instance
ls -lah /path/jenkins-key.pem
chmod 400 /path/jenkins-key.pem
ssh -i /path/jenkins-key.pem
ec2-user@ec2-123-456-78-9.compute-1.amazonaws.com
Once your installation is done please start and enable your Jenkins service by saying -
# start Jenkins at boot time
sudo systemctl start jenkins.service
sudo systemctl enable jenkins.service
If you want to restart your Jenkins please follow below steps -
#Restart Jenkins
sudo /etc/init.d/jenkins restart
Make sure you have installed git if you are dealing with cloning repository from bitbucket or Github or any other platform -
# install git
sudo yum install git
5. Install Jenkins on RPM Distros Operating System
For installation of Jenkins on rpm distros please follow up the below steps -
# Add yum repo and install Jenkins
sudo wget -O /etc/yum.repos.d/jenkins.repo
http://pkg.jenkins-ci.org/redhat-stable/
jenkins.repo
sudo rpm --import
http://pkg.jenkins-ci.org/
redhat-stable/jenkins-ci.org.key
sudo yum install jenkins
Once your installation is done please start and enable your Jenkins service by saying -
# Start Jenkins at boot time
sudo systemctl start jenkins.service
sudo systemctl enable jenkins.service
If you want to restart your Jenkins please follow below steps -
#Restart Jenkins
sudo /etc/init.d/jenkins restart
6. Install Jenkins on Ubuntu Operating System
For installation of Jenkins on ubuntu please followup the below steps -
# Add PPA repo for Jenkins stable LTS
wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key
| sudo apt-key add -
sudo sh -c "echo deb http://pkg.jenkins.io/debian-stable binary/ >
/etc/apt/sources.list.d
/jenkins.list"
sudo apt-get update
# Install Jenkins
sudo apt-get install jenkins
Once your installation is done please start and enable your Jenkins service by saying -
# Start Jenkins at boot time
sudo systemctl start jenkins.service
sudo systemctl enable jenkins.service
If you want to restart your Jenkins please follow below steps -
#Restart Jenkins
sudo /etc/init.d/jenkins restart
7. Install Jenkins with Docker
For installation of Jenkins with docker please follow the below steps -
# Pull official Docker image for Jenkins LTS
docker pull jenkins/jenkins:lts
# Start Docker container
docker run -p 8080:8080 -p
50000:50000 -v
jenkins_home:/var/jenkins jenkins/jenkins:lts
# Start Docker container in detached mode
docker run -p 8080:8080 -p 50000:50000 -v
jenkins_home:/var/jenkins -d
jenkins/jenkins:lts
8. Unlock Jenkins
Once your installation is done you can type from your browser -
If you have installed Jenkins in your local system then -
If you have installed Jenkins in your server then -
Your_Server_Public_Ip:8080
You will get the below screen -
 |
| Unlock Jenkins |
Order to get the password from you command prompt do -
cat the_path_is_provided_on_screen_like
cat
/var/lib/jenkins/secretes/initialAdminPassword
Please copy the password from the terminal and click on continue, you will see -
 |
| Customize Jenkins |
Click on Install Suggested Plugins, then -
 |
| Jenkins Getting Started |
Once your installation is done, you will be asking for reset password -
 |
| Reset your username and password |
Click on save and continue,
 |
| Jenkins Instance Configuration |
Click on save and continue and congratulations, we have successfully installed Jenkins Server. Hit start using Jenkins -
 |
| Jenkins is ready |
Then you will see the below screen -
 |
| Welcome to Jenkins - Start Create New Job |
More details please visit my youtube video -