Install and configure Jenkins on CentOS

Install and configure Jenkins on CentOS
Written by Abhishek JalanApril 18, 2020
1 min read
Jenkins
6 VIEWS 1 LIKES 0 DISLIKES SHARE
1 LIKES 0 DISLIKES 6 VIEWS SHARE
Abhishek Jalan

Founder of Wikiance, DevOps Engineer

Let's install Jenkins on CentOS

Jenkins Installation and setup

SSH to CENTOS Machine with root credentials.

Please follow the below steps:

yum install -y wget vim  
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
sudo yum install jenkins java-1.8.0-openjdk
systemctl enable jenkins
systemctl start jenkins
systemctl status jenkins
yum install epel-release
yum install nginx
getenforce
/usr/sbin/setsebool httpd_can_network_connect true
yum install -y setroubleshoot-server selinux-policy-devel
sepolicy network -t http_port_t
semanage port -m -t http_port_t -p tcp 8080
setenforce 1
getenforce

To get Jenkins setup password:

cat /var/lib/jenkins/secrets/initialAdminPassword

Open Browser: https://jenkinsserverip:8080 & copy the password to the browser

Now, Select default plugins and follow the instruction.

Create user account and click on finish

Now we will give root privilege to Jenkins user account.

cat /etc/passwd | grep jenkins
jenkins:x:998:996:Jenkins Automation Server:/var/lib/jenkins:/bin/false

modify the passwd file with below line (added bash in last)

jenkins:x:998:996:Jenkins Automation Server:/var/lib/jenkins:/bin/bash

Change jenkins user password:

passwd jenkins

Login with Jenkins User:

su - jenkins
ssh-keygen (use default value by pressing enter)
ssh-copy-id jenkins@localhost
"enter password"

from root shell

visudo

Add below line and save the file

jenkins ALL=(ALL) NOPASSWD: ALL

*********** setup completed in Jenkins Server ******************

jenkins
centos
6 VIEWS 1 LIKES 0 DISLIKES SHARE
1 LIKES 0 DISLIKES 6 VIEWS SHARE
Was this blog helpful?
You must be Logged in to comment
Code Block
Abhishek Jalan
Founder of Wikiance, DevOps Engineer
14 Blog Posts
4 Discussion Threads
Trending Categories
37
Software1
DevOps15
Frontend Development4
Backend Development2
Server Administration1
Linux Administration5
Data Center0
Sentry0
Terraform2
Ansible0
Docker3
Penetration Testing0
Kubernetes0
NGINX0
JenkinsX0
Jenkins2
SSL0
Ethical-Hacking1
Python0
NodeJs1
RedHat0
Github0
AngularJs0
Google Cloud Platform (GCP)0
SonarQube0
Amazon Web Service (AWS)0
VMware0
Blockchain0
Snipe-IT1
MongoDB0