Installing and configuring Jenkins on Redhat Linux / CentOS is very straight forward. Jenkins is a very famous tool among developers. Jenkins is an open source automation platform written in Java. The creator of Jenkins is Kohsuke Kawaguchi and it has been developed when he was working at Sun Microsystems. Jenkins supports most of the major operating systems. Here is the list of supported operating system.
- Arch Linux
- FreeBSD
- Mac OS X
- OpenBSD
- openSUSE
- Red Hat/Fedora/CentOS
- Ubuntu/Debian
- Windows
This article will walk through the deployment of Jenkins on Redhat Enterprise Linux 7 / CentOS 7.
System Configuration:
- Redhat Linux 7 / Cent OS
- Memory – 16GB
- vCPU – 2
- Hard disk – 50GB
- Network – Access to the internet
- Access to EPEL/Redhat Repositories or Local DVD Repositories.
1. Login to Rehat Linux 7/ Centos 7 VM as root user.
2. Ensure firewalld is disabled to avoid connection issue.
3. Disable the SELinux. (Refer this article to disable SELinux)
4. Install Open JDK from yum repository.
~]# yum install java-1.8.0-openjdk-devel Loaded plugins: product-id, search-disabled-repos, subscription-manager Resolving Dependencies ---> Package libfontenc.x86_64 0:1.1.3-3.el7 will be installed --> Finished Dependency Resolution Install 1 Package (+16 Dependent packages) Upgrade ( 7 Dependent packages) Total download size: 45 M Is this ok [y/d/N]: y
5. Pull the Jenkins Repo file.
~]# curl --silent --location http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo | sudo tee /etc/yum.repos.d/jenkins.repo [jenkins] name=Jenkins-stable baseurl=http://pkg.jenkins.io/redhat-stable gpgcheck=1 #
6. Install Jenkins using the following command.
~]# yum install jenkins Loaded plugins: product-id, search-disabled-repos, subscription-manager jenkins | 2.9 kB 00:00:00 jenkins/primary_db | 28 kB 00:00:00 Resolving Dependencies --> Running transaction check ---> Package jenkins.noarch 0:2.150.3-1.1 will be installed --> Finished Dependency Resolution Dependencies Resolved ======================================================================================= Package Arch Version Repository Size ======================================================================================== Installing: jenkins noarch 2.150.3-1.1 jenkins 72 M Transaction Summary ====================================================================================== Install 1 Package Total download size: 72 M Installed size: 72 M Is this ok [y/d/N]: y Downloading packages: jenkins-2.150.3-1.1.noarch.rpm | 72 MB 00:01:41 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : jenkins-2.150.3-1.1.noarch 1/1 Verifying : jenkins-2.150.3-1.1.noarch 1/1 Installed: jenkins.noarch 0:2.150.3-1.1 Complete! #
7. Start the Jenkins service using systemctl.
# systemctl start jenkins
8. Check the Jenkins service status. It should be up & running.
# systemctl status jenkins.service ● jenkins.service - LSB: Jenkins Automation Server Loaded: loaded (/etc/rc.d/init.d/jenkins; bad; vendor preset: disabled) Active: active (running) since Mon 2019-03-11 14:13:49 EDT; 8s ago Docs: man:systemd-sysv-generator(8) Process: 19095 ExecStart=/etc/rc.d/init.d/jenkins start (code=exited, status=0/SUCCESS) CGroup: /system.slice/jenkins.service └─19115 /etc/alternatives/java -Dcom.sun.akuma.Daemon=daemonized -Djava.awt.headless=true -DJENKINS_HOME=/var/lib... Mar 11 14:13:48 UnixArena-Jenkins systemd[1]: Starting LSB: Jenkins Automation Server... Mar 11 14:13:48 UnixArena-Jenkins runuser[19096]: pam_unix(runuser:session): unrecognized ENCRYPT_METHOD value [DES] Mar 11 14:13:48 UnixArena-Jenkins runuser[19096]: pam_unix(runuser:session): session opened for user jenkins by...d=0) Mar 11 14:13:49 UnixArena-Jenkins runuser[19096]: pam_unix(runuser:session): unrecognized ENCRYPT_METHOD value [DES] Mar 11 14:13:49 UnixArena-Jenkins jenkins[19095]: Starting Jenkins [ OK ] Mar 11 14:13:49 UnixArena-Jenkins systemd[1]: Started LSB: Jenkins Automation Server. Hint: Some lines were ellipsized, use -l to show in full.
9. It’s time to access the Jenkins portal from the browser. (Assuming that there is no firewall between your desktop & Jenkins host). Just view the given file location to know the administrator password.
10. Go with the recommended plugin. Select “Install Suggested Plugins” to continue.
11. Jenkins installs the suggested plugins.
12. Create a first admin user for Jenkins.
13. Here is the final configuration page for Jenkins to commit the changes.
Welcome to Jenkins.
We have successfully deployed Jenkins on RHEL 7 / CentOS 7. In upcoming articles, we will explore more about Jenkins plugins and more use case on the enterprise infrastructure side.
Share it! Comment it !! Be Sociable !!!
Alex says
You should run this if you get an error with the key
rpm –import https://pkg.jenkins.io/redhat/jenkins.io.key
Thanks,
Alex.
Dnyaneshwar says
Please import the public key before installing jenkins rpm.
rpm –import https://pkg.jenkins.io/redhat-stable/jenkins.io.key