> ## Content Index
> Fetch the complete content index at: https://devopscube.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# How to Install and Configure Jenkins 2 on centos/Redhat Servers
- URL: https://devopscube.com/install-configure-jenkins-2-centos-redhat-servers/
- Published: 2020-04-03T05:22:00.000Z
- Updated: 2025-03-15T11:43:05.000Z
- Author: devopscube
- Tags: CI/CD, JENKINS, jenkins 2, #Migrated-1741795015845, #wp, #wp-post, #Import 2025-03-12 15:57, #blog

In our [previous post,](https://devopscube.com/install-configure-jenkins-2-0/) we explained the latest Jenkins features and installation for Debian-based servers. As per a few user requests, we have created the steps for installing Jenkins 2 versions on centos and Redhat servers.

## Jenkins 2 on centos/Redhat

This tutorial will guide you to install Jenkins 2 on a centos/Redhat machines.

### Prerequisites:

1. Make sure port 22 and 8080 are open in your server firewall.
2. You should have `sudo` access to execute the commands.

**Step 1:** Install prerequisites.

```
sudo yum install wget git -y
```

**Step 2:** Install java 11 JDK

```
sudo yum install java-11-openjdk-devel -y
```

**Step 3:** Add the LTS Jenkins repository.

```
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
```

****Note:** It is recommended to use the LTS version for Jenkins. You can check out the latest [LTS version from here](https://jenkins.io/changelog-stable/?ref=devopscube.com).

**Step 4:** Import the repo key.

```
sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
```

**Step 5:** There are many Jenkins 2 versions. To install the specific version, you need to get the version list from yum. Use the following command to get the list of available Jenkins versions.

```
sudo yum --showduplicates list jenkins | expand
```

You will see a list like the following.

jenkins.noarch 2.6-1.1 jenkins jenkins.noarch 2.7-1.1 jenkins jenkins.noarch 2.8-1.1 jenkins jenkins.noarch 2.9-1.1 jenkins

**Step 6:** Select a specific version of your choice and install it using the following syntax.

```
sudo yum install (package name)-(version info)
```

For example, if you want to install 2.9-1.1, you can execute the command as shown below.

```
sudo yum install jenkins-2.222.1-1.1
```

Or simply execute the following command, it will install the latest LTS version.

```
sudo yum install jenkins -y
```

**Step 7:** Start the Jenkins 2 service.

```
sudo systemctl start jenkins
```

**Step 8:** Enable Jenkins as a startup service.

```
sudo systemctl enable jenkins
```

**Step 9:** Access the Jenkins dashboard on port 8080 using your servers IP address.

```
http://<jenkins-ip>:8080
```

**Step 10:** Open the following file in the terminal and copy the password. supply the password on the dashboard.

```
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
```

![](https://storage.ghost.io/c/5f/2f/5f2f4d20-2abf-4534-8d40-7aa233aedd43/content/images/2025/03/image-333.png)

Click to view in HD

**Step 11:** Install suggested plugins

![](https://storage.ghost.io/c/5f/2f/5f2f4d20-2abf-4534-8d40-7aa233aedd43/content/images/2025/03/image-1-60.png)

Click to view in HD

**Step 12:** Create a admin Jenkins user.

![](https://storage.ghost.io/c/5f/2f/5f2f4d20-2abf-4534-8d40-7aa233aedd43/content/images/2025/03/image-4-57.png)

Click to view in HD

**Step 13:** All the other steps are self-explanatory. You can follow the dashboard steps start using Jenkins

To add slaves, you can follow the [Jenkins SSH slave setup](https://devopscube.com/setup-slaves-on-jenkins-2/) article.