On today’s tutorial I will guide you step by step on how to install Jenkins on CentOS 8 Stream. Jenkins is a free, open-source platform for automate the system which support for CI/CD development (Continuous Integration and Continuous Delivery) of software on a certain scale. Jenkins is supported with many plugin in order to deploy, build and automate your apps. The latest stable version of Jenkins is currently version 2.332.3 which released in March 1, 2022.
You can run Jenkins in various distribution system since it’s actually self-contained Java-based program. In addition, you can also install Jenkins using Graphical User Interface (GUI). There are available easily installation instruction for developer on many operating system like MacOS, Windows, or Linux. In addition, it can also run in container-based system.
The integrated Jenkins plugins is expected to allow developer in deploying or build and make testing on their apps in different ecosystems. Moroever, Jenkins can act as standalone program that running under its own process. Considering that is actually a built-in Java servlet container or Jetty application-based server. Jenkins can also running in other ecosystems as an server-based system (servlet) in different Java servlet containers, including Apache Tomcat or GlassFish.
You can also run Jenkins as a simple CI-based server and change it into the CD Hub to support your development projects. Apache Maven, CVS, AccuRev, Git, Mercurial, and Subversion are different version control system which are supported by Jenkins. Make sure to meet the following pre-requisites before installing Jenkins on CentOS 8 Stream.
* VPS, Cloud, or Bare-Metal Server * Distro with CentOS 8 Stream * Server IPv4 Address with SUDO Access * Gnome Terminal for Linux Desktop * PuTTy SSH Client for Windows or Mac * Powershell for Windows 10/11 Minimum hardware requirements: ** Memory: 256 MB ** Storage: 1GB (10GB if running Jenkins in Docker container) Recommended hardware configuration for a small team: ** Memory: 4 GB+ ** Storage: 50 GB+
1.) SSH Login to the Server
First of all, you need to login into your server via SSH terminal. Make sure to change the server IPv4 address, SSH port and root password with your actual server login credentials. Simply run the following command.
$ ssh [email protected] -p22
[email protected]'s password:
Activate the web console with: systemctl enable --now cockpit.socket
Last failed login: Mon Jun 6 19:05:02 UTC 2022 from 184.108.40.206 on ssh:notty
There were 5338 failed login attempts since the last successful login.
Last login: Wed Jun 1 11:03:37 2022 from 220.127.116.11
[[email protected] ~]#
2.) Let’s Adding Adding RHEL/CentOS Repository for Jenkins
We will use Jenkins LTS or Long-Term Support release on CentOS 8 Stream, since it chosen every 12 weeks from the stream of regular releases as the stable release for that time period. So, simply run the following command to adding RHEL/CentOS repository to install Jenkins on CentOS 8 Stream.
$ sudo wget -O /etc/yum.repos.d/jenkins.repo \ https://pkg.jenkins.io/redhat-stable/jenkins.repo $ sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key $ sudo yum upgrade
3.) Install Java 11
Then we need to install Java 11 as it’s required dependencies for the Jenkins package on CentOS 8 Stream. Please note that currently only Java 8 and Java 11 which support Jenkins. Another Java versions are not yet supported by Jenkins right now.
$ sudo yum install java-11-openjdk
Verify Java version using the following command:
$ java --version
4.) Install Jenkins on CentOS 8 Stream
We will only install the latest stable release of Jenkins LTS (Long-Term Support) in CentOS 8 Stream. Please note: don’t install the Jenkins Weekly Release or non-stable versions since it still be in development phases.
$ sudo yum install jenkins
Verify installed Jenkins with the following command to print out the Jenkins version on your CentOS 8 machine.
$ jenkins --version
Then, let’s reload system daemon using the following command.
$ sudo systemctl daemon-reload
5.) Available Command to Manage Jenkins on CentOS 8 Stream
There are available some simple commands to manage Jenkins Server on your CentOS 8 Stream as follow.
Enabling Jenkins Service to start from boot.
$ sudo systemctl enable jenkins
To Start Jenkins Service
$ sudo systemctl start jenkins
To Stop Jenkins Service
$ sudo systemctl stop jenkins
To Restart Jenkins Service
$ sudo systemctl restart jenkins
To Check Jenkins Service State
$ sudo systemctl status jenkins
6.) Let’s Configure Jenkins via Web Browser
Then you can configure your Jenkins installation using web browsers like Google Chrome or Mozilla Firefox:
* Jenkins URL: http://server_IPv4_address:8080/
However, on my side, I will configure Jenkins at the following URL:
* Jenkins URL: http://18.104.22.168:8080/
7.) Setting up Jenkins Service on CentOS Stream
In order to unlock Jenkins you should print out the Initial Jenkins Admin Password, which is actually administrator password that put into the initialAdminPassword secret file. Simply use tail -f command to print out the Admin Password.
$ tail -f /var/lib/jenkins/secrets/initialAdminPassword
7.) Install Recommended Plugins, Create Admin User and Finish Configuring Jenkins
After that you can install some recomended Jenkins plugins when configure it via web browser. The plugins must be installed if you want extend Jenkins with some additional features. Moving forward, simply create a first administrator Jenkins user and then finished Jenkins configurations. See the following screenshot for more details.
From this step you have know that installing Jenkins Server on CentOS 8 Stream is easy enough and don’t need many complicated installation methods. Then you can utilize Jenkins to support various software development project or automate your applications.