DEV Community

Wycliffe A. Onyango
Wycliffe A. Onyango

Posted on

100 Days of DevOps: Day 69

Setting Up Jenkins for CI/CD at xFusionCorp Industries

Overview

As part of xFusionCorp Industries’ DevOps initiative, the team has begun setting up Continuous Integration and Continuous Deployment (CI/CD) pipelines using Jenkins. The goal of this task was to install Jenkins on the designated server, configure it correctly, and create the first admin user who will manage builds and pipelines.


Step 1: Environment Setup

Access to the Jenkins server was done from the jump host using:

ssh root@jenkins
# Password: S3curePass
Enter fullscreen mode Exit fullscreen mode

Before installation, the environment was updated to ensure compatibility with the latest Jenkins release.

Step 2: Installing Jenkins via YUM

Jenkins was installed using the YUM package manager, following best practices for Red Hat–based systems.

yum install wget -y
wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io-2023.key
yum install jenkins -y
Enter fullscreen mode Exit fullscreen mode

This method ensures Jenkins can receive future updates via standard package management tools.


Step 3: Installing Java 21

Since newer Jenkins versions require Java 17 or later, OpenJDK 21 was installed:

yum install java-21-openjdk -y
java -version
Enter fullscreen mode Exit fullscreen mode

Output confirmed:

openjdk version "21.0.8" 2025-07-15 LTS
Enter fullscreen mode Exit fullscreen mode

Step 4: Configuring Jenkins

Essential configuration adjustments were made to ensure Jenkins runs smoothly.

vi /etc/sysconfig/jenkins
Enter fullscreen mode Exit fullscreen mode

Then, directories were created and permissions corrected:

mkdir -p /var/log/jenkins
chown -R jenkins:jenkins /var/log/jenkins
chmod 755 /var/log/jenkins
Enter fullscreen mode Exit fullscreen mode

The Jenkins system user was updated with the appropriate identity:

usermod -c "mariyam@jenkins.stratos.xfusioncorp.com" -s /sbin/nologin jenkins
Enter fullscreen mode Exit fullscreen mode

Step 5: Enabling and Starting Jenkins

After reloading systemd, the Jenkins service was enabled and started:

systemctl daemon-reload
systemctl enable jenkins
systemctl start jenkins
Enter fullscreen mode Exit fullscreen mode

Service status confirmed successful startup:

Active: active (running)
Main PID: 6091 (java)
Enter fullscreen mode Exit fullscreen mode

Step 6: Accessing Jenkins UI

The initial admin password was retrieved to unlock Jenkins:

cat /var/lib/jenkins/secrets/initialAdminPassword
Enter fullscreen mode Exit fullscreen mode

Using this token, Jenkins was accessed via the web interface and unlocked successfully.

Step 7: Creating the Admin User

Through the Jenkins setup wizard, the first administrator account was created with the following details:

Field Value
Username theadmin
Password Adm!n321
Full Name Mariyam
Email mariyam@jenkins.stratos.xfusioncorp.com

After completing the setup, Jenkins displayed the dashboard confirming the configuration was successful.

Results

  • Jenkins installed and configured using YUM.
  • Running on Java 21 (LTS).
  • Service enabled and verified to start automatically.
  • First admin user “theadmin” successfully created.
  • Email correctly set to mariyam@jenkins.stratos.xfusioncorp.com.

Conclusion

The Jenkins installation at xFusionCorp Industries was successfully completed, establishing the foundation for automated build and deployment pipelines. With this setup, the DevOps team can now integrate repositories, run tests automatically, and streamline deployments across environments.

Top comments (0)