• Home
  • Linux
  • Ubuntu
  • Debian
  • CentOS
  • Linux Commands
  • About Us
  • Donate
TecNStuff
Menu
  • Home
  • Linux
  • Ubuntu
  • Debian
  • CentOS
  • Linux Commands
  • About Us
  • Donate

How to Install Jenkins on CentOS 8

Written by Admin, Updated On April 26, 2020
centos, jenkins
How to Install Jenkins on CentOS 8

Jenkins is popular and an open-source Java-based automation server. It’s a continuous integration tool that offers number of plugins for building deployments and automation for your applications. This also helps to automate the repetitive tasks involved in the software development process. In this tutorial, we will cover how to install Jenkins on CentOS 8 system.

Step 1 – Prerequisites#

  • You must be login as root or user with sudo privileges.
  • Jenkins is written in Java, it required Java runtime environment for running. If you don’t have Java installed on your system, run below commands to install Java:
sudo dnf install java-1.8.0-openjdk-devel

Step 2 – Enable Jenkins PPA#

We will download and import the Jenkins repository GPG keys using wget:

sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo
sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key

Step 3 – Install Jenkins on CentOS#

Run the following command to install the latest version of Jenkins:

sudo yum install jenkins

The default Jenkins runs on port 8080. If other service is using same port, you can edit /etc/default/jenkins configuration file and update HTTP_PORT value to 8081 or other port.

HTTP_PORT=8080

After that, start the Jenkins service and enable it to start on system boot:

sudo systemctl start jenkins
sudo systemctl enable jenkins

Check the status of Jenkins service by typing:

sudo systemctl status jenkins

It should show output as below:

Loaded: loaded (/etc/rc.d/init.d/jenkins; generated)
Active: active (running) since Thu 2020-04-20 13:45:26 UTC; 36s ago

Step 4 – Adjust Firewall#

If your server is secure under firewall, you need to open port 8080.

sudo firewall-cmd --permanent --zone=public --add-port=8080/tcp
sudo firewall-cmd --reload

Step 5 – Setting Up Jenkins#

To access your server, open your favorite browser and type your domain or IP address, followed by port 8080 (or changed port), http://your_domain_or_ip_address:8080.

It will show screen as below.

unlock-jenkins

The default installation password can be found at /var/lib/jenkins/secrets/initialAdminPassword as showing in above image. To find the password type:

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

Enter the password it into the Administrator password field and click on Continue.

customize-jenkins

Next, you will be asked to install suggested plugins or you want to select specific plugins. Click on the Install suggested plugins box, and the installation process will start immediately.

Next, create an admin account for your Jenkins setup. Fill out the required information and click Save and Continue.

jenkins-create-admin-user

After that, page will ask you to set the URL for your Jenkins instance. The field will be populated with an automatically generated URL.

jenkins-instance-configuration

Check the URL and click on the Save and Finish button to complete the process.

jenkins-is-ready

Click on the Start using Jenkins button, and you will be redirected to the Jenkins dashboard logged in as the admin user you have created in one of the previous steps.

jenkins-homepage

That’s it, you’ve successfully installed Jenkins on your system.

Conclusion#

You have learned how to install and complete the initial configuration of Jenkins on CentOS 8 system. You can take a look at official Jenkins documentation page to learn more about Jenkins.

If you have any questions or suggestion, please leave a comment below.

If our content helps you, please consider buying us a coffee

Thank you for your support.

Share On
Share on Facebook
Share on Twitter
Share on Reddit
Share on Tumblr
 Previous Article How to Install Pip on Ubuntu 20.04
Next Article   How to Set Up a Firewall with UFW on Debian 10

Related Posts

  • How to Install Jenkins on Debian 11

    How to Install Jenkins on Debian 11

    January 5, 2023
  • How to Install Jenkins on Ubuntu 22.04

    How to Install Jenkins on Ubuntu 22.04

    December 23, 2022
  • How to Install Php 8 on CentOS 8

    How to Install PHP 8 on CentOS 8

    January 27, 2021

Leave a Reply Cancel reply

DigitalOcean Referral Badge

Popular Posts

  • How to Install Microsoft Edge Browser on Ubuntu 22.04
    How to Install Microsoft Edge Browser on Ubuntu 22.04 March 14, 2023
  • How to Install Ruby on Ubuntu 22.04 LTS
    How to Install Ruby on Ubuntu 22.04 LTS February 27, 2023
  • How to Install LEMP Stack on Ubuntu 22.04
    How to Install LEMP Stack on Ubuntu 22.04 March 18, 2023
  • How to Install Set Up Apache Virtual Hosts on Ubuntu 22.04
    How to Set Up Apache Virtual Hosts on Ubuntu 22.04 March 2, 2023
  • How to Install MariaDB on Debian 11 Bullseye
    How to Install MariaDB on Debian 11 Bullseye March 8, 2023
© 2020 TecNStuff All rights reserved. This website is using and storing cookies on your browser. By using this website you agree our Privacy Policy.  Follow us -  Twitter | Facebook