# Jenkins installation on Linux (CentOS 8)

In 
Published 2020-11-25

# Prerequisites

Minimum hardware requirements:

  • 256 MB of RAM
  • 1 GB of drive space (although 10 GB is a recommended minimum if running Jenkins as a Docker container)

Recommended hardware configuration for a small team:

  • 4 GB+ of RAM
  • 50 GB+ of drive space

For more details you can take a look on the official Jenkins site.

On CentOs 8, the first step is to create the group and the user which will manage the Jenkins installation:

as root:
groupadd jenkins
useradd -g jenkins jenkins
passwd jenkins

We can create a directory where we will keep different artifacts later (but this is not a mandatory step):

as root:
mkdir -p /u01/jenkins
chown -R jenkins: jenkins /u01/jenkins

We can install wget and other tools we will need in the future (wget is mandatory, the others are optional).

as root:
yum -y install wget curl
Install Java 17 on the machine :
as root:
dnf -y install java-17-openjdk java-17-openjdk-devel

# Get Jenkins repository to your system

By default, the Jenkins package is not included in the CentOS 8 default repository. So you will need to add the Jenkins repo to your system. You can add it using the following command:

as root:
wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo

# Import Jenkins GPG Key

as root:
rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key

# Installation steps

Start Jenkins installation on Linux/ CentOS 8 :

as root:
dnf install -y jenkins

... and Linux will be installed immediately :

It is better to enable the Jenkins service to start at boot :

as root:
systemctl enable jenkins

Start the Jenkins service :

as root:
systemctl start jenkins

Check the status of the Jenkins service :

as root:
systemctl status jenkins

The result will be something like this:

Jenkins is work on port 8080 so we need to allow connections on that port by adding it in firewall:

as root:
firewall-cmd --zone=public --permanent --add-port=8080/tcp
firewall-cmd --reload

In order to test the installation you need to go the http://localhost:8080 . The following page will be displayed:

Take a look in this file and take the Jenkins admin password in /var/lib/jenkins/secrets/initialAdminPassword. Enter the password into that page and you will see the following page:

Click on "Install suggested plugins" and the most used plugins will be installed. You will see a page as below:

When the installation is completed you will be prompted to create your first admin user.

I will skip this step for now. The following page will be displayed:

Click on "Save and Finish" and the installation is done. You will see the following on the screen:

When you press on "Start using Jenkins" you will see Jenkins console.

Enjoy Jenkins installation on Linux/CentOS !