DEV Community

Cover image for Set Up Jenkins on RHEL/CentOS Using YUM – Step-by-Step with Admin Setup
Anusha Kuppili
Anusha Kuppili

Posted on

Set Up Jenkins on RHEL/CentOS Using YUM – Step-by-Step with Admin Setup

Hey there! 👋

If you’re just diving into DevOps or prepping your Linux server for automation, Jenkins is probably already on your radar. It’s one of the most popular open-source automation servers out there — and for good reason.

In this guide, I’ll show you how to install Jenkins on a RHEL or CentOS system using yum, and walk you through setting up the admin user. No fluff — just what you need to get started fast.


🧰 Step 1: Install Java

Jenkins needs Java to run, so let’s start there. I recommend OpenJDK 11:

sudo yum install java-11-openjdk -y
Enter fullscreen mode Exit fullscreen mode

💂️ Step 2: Add the Jenkins Repository

Jenkins isn’t available in the default repos, so we’ll add the official one:

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-2023.key
Enter fullscreen mode Exit fullscreen mode

📆 Step 3: Install Jenkins

Now that the repo is added, install Jenkins:

sudo yum install jenkins -y
Enter fullscreen mode Exit fullscreen mode

⚙️ Step 4: Start and Enable the Jenkins Service

Let’s start Jenkins and make sure it runs on boot:

sudo systemctl start jenkins
sudo systemctl enable jenkins
Enter fullscreen mode Exit fullscreen mode

⚠️ Timeout warning:Sometimes Jenkins takes longer to start and you might hit a timeout. If that happens, here’s a quick fix:

sudo mkdir -p /etc/systemd/system/jenkins.service.d
sudo nano /etc/systemd/system/jenkins.service.d/override.conf
Enter fullscreen mode Exit fullscreen mode

Add this inside:

[Service]
TimeoutStartSec=600
Enter fullscreen mode Exit fullscreen mode

Then reload and restart:

sudo systemctl daemon-reload
sudo systemctl restart jenkins
Enter fullscreen mode Exit fullscreen mode

🌐 Step 5: Access Jenkins in Your Browser

Once Jenkins is running, open up your browser and go to:
http://:8080

You’ll see an “Unlock Jenkins” screen. To get the password, run:

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


bash
Copy and paste that into the web UI to continue.

👤 Step 6: Create the Admin User

Now Jenkins will prompt you to create an admin user. Here's an example setup:

Username: theadmin

Password: Adm!n321

Full Name: Anita

Email: anita@jenkins.example.com

You can use these or customize as needed.
Enter fullscreen mode Exit fullscreen mode

🎯 What’s Next?

That’s it — Jenkins is up and running! From here, you can:

Start creating jobs (freestyle or pipeline)

Install essential plugins

Connect GitHub or GitLab

Prep for your CI/CD workflow

✨ Wrapping Up

Installing Jenkins on CentOS or RHEL using yum is a quick way to kick off your automation journey. Whether you’re setting up a home lab or prepping for production, this gives you a solid base to build on.

If you found this guide helpful, drop a like or follow. I’ll be posting more DevOps, Linux, and automation content here on Dev.to!

Top comments (0)