You can support us by downloading this article as PDF from the Link below. Download the guide as PDF

How can I install Jenkins on CentOS 7?. Jenkins is an open source automation server written in Java that was designed to automate repetitive tasks that are often encountered in continuous integration and delivery of software. Jenkins is typically run as a standalone application in its own process with the built-in Java servlet container/application server (Jetty).

Minimum Hardware requirements:

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

For Ubuntu, see: How to Install Jenkins on Ubuntu

For Arch Linux: How to Install and Configure Jenkins on Arch Linux

For Docker Container: Running Jenkins Server in Docker Container with Systemd

Step 1: Install Jenkins on CentOS 7

Jenkins requires Java in order to run, but CentOS 7 doesn’t include it by default. To install the Open Java Development Kit (OpenJDK) run the following:

sudo yum -y install epel-release
sudo yum install java-1.8.0-openjdk

Check to make sure that you have java installed by running:

$ java -version
openjdk version "1.8.0_201"
OpenJDK Runtime Environment (build 1.8.0_201-b09)
OpenJDK 64-Bit Server VM (build 25.201-b09, mixed mode)

Start by importing the repository key from Jenkins:

sudo rpm --import

After importing the key, add the repository to the system:

sudo yum -y install wget
sudo wget -O /etc/yum.repos.d/jenkins.repo

Then install Jenkins package using yum:

sudo yum -y install jenkins

If you need the LTS release only, run the following commands instead:

sudo wget -O /etc/yum.repos.d/jenkins.repo
sudo rpm --import
sudo yum -y install jenkins

You can now start Jenkins service using:

sudo systemctl start jenkins
sudo systemctl enable --now jenkins

A check on status should return running state

$ sudo systemctl status jenkins
 ● jenkins.service - LSB: Jenkins Automation Server
    Loaded: loaded (/etc/rc.d/init.d/jenkins; bad; vendor preset: disabled)
    Active: active (exited) since Thu 2019-03-07 09:23:25 CET; 4s ago
      Docs: man:systemd-sysv-generator(8)
   Process: 15039 ExecStart=/etc/rc.d/init.d/jenkins start (code=exited, status=0/SUCCESS)
 Mar 07 09:23:24 centos-2gb-nbg1-1 systemd[1]: Starting LSB: Jenkins Automation Server…
 Mar 07 09:23:25 centos-2gb-nbg1-1 runuser[15044]: pam_unix(runuser:session): session opened for user jenkins by (uid=0)
 Mar 07 09:23:25 centos-2gb-nbg1-1 jenkins[15039]: Starting Jenkins [  OK  ]
 Mar 07 09:23:25 centos-2gb-nbg1-1 systemd[1]: Started LSB: Jenkins Automation Server.

Enable port 8080/tcp on the firewall:

sudo firewall-cmd --add-port=8080/tcp --permanent
sudo firewall-cmd --reload
sudo firewall-cmd --list-all

The service should be listening on port 8080

$ sudo ss -tunelp | grep 8080
tcp    LISTEN     0      50       :::8080                 :::*     

Step 2: Unlock Jenkins on CentOS 7

Browse to the URL http://[serverip|hostname]:8080 to access web installation wizard.

When you first access a new Jenkins instance, you are asked to unlock it using an automatically generated password.

unlock jenkins centos7 min

Get the password from

$ cat /var/lib/jenkins/secrets/initialAdminPassword

Copy-paste the automatically-generated alphanumeric password into the Administrator password field and click Continue.

jenkins install plugins min

Next is to create an admin user account used to manage the Jenkins server.

install jenkins centos7 set admin account min

Select plugins to install in the next page.

install jenkins arch linux 02 min

Step 3: Configure Nginx and SSL (Optional)

It is recommended to access Jenkins Server behind a Proxy server secured with SSL certificate. Check below guide.

Configure Jenkins behind Nginx reverse proxy and Let’s Encrypt SSL

Step 4: Configure User Roles on Jenkins

By default, Jenkins user policy allows logged in users to access anything. This should not be the case and you need to set proper user policies. Check out our Jenkins policy and user management guide below.

How to Manage Users and Roles in Jenkins

Let other users Login with their credentials and assign them roles which define what they can do on Jenkins server.


Enjoy automating your jobs with Jenkins. For more reading, check Official Documentation. We will publish more articles on Jenkins and CI/CD.

Also check:

How to Manage Users and Roles in Jenkins

Configure Jenkins behind Nginx reverse proxy and Let’s Encrypt SSL

How to Configure Jenkins FreeIPA LDAP Authentication

Running Jenkins Server in Docker Container with Systemd

Install and Configure Hashicorp Vault Server on Ubuntu / CentOS / Debian

How to Install Terraform on Ubuntu / CentOS

As an appreciation for the content we put out,
we would be thrilled if you support us!

As we continue to grow, we would wish to reach and impact more people who visit and take advantage of the guides we have on our blog. This is a big task for us and we are so far extremely grateful for the kind people who have shown amazing support for our work over the time we have been online.

Thank You for your support as we work to give you the best of guides and articles. Click below to buy us a coffee.


Please enter your comment!
Please enter your name here