Home Linux ServerTools How to install Jenkins on CentOS 7

How to install Jenkins on CentOS 7

by Thạch Phạm
Published: Last Updated on
A+A-
Reset

Instructions to install Jenkins on Centos 7 with just a few basic commands with AZDIGI.

I. Introduction

What is Jenkins?

Jenkins is an automation software, open source and written in Java. It is used to perform continuous integration (CI) functionality and builds automation tasks.

Jenkins helps automate processes in software development, now referred to as Continuous Integration, and is also used in Continuous Delivery. Jenkins is a servlet-based, server-side software with the support of Apache Tomcat. It supports the most popular source code management software such as Git, Subversion, Mercurial, ClearCase… Jenkins also supports Shell and Windows Batch scripts and can run Apache Ant scripts. , Maven, Gradle… The creator of Jenkins is Kohsuke Kawaguchi. Released under the MIT license, Jenkins is free software.

In addition, you can learn more about Jenkins at the homepage: https://www.jenkins.io/doc/

II. Implementation Guide

Linux

The Jenkins installer is available for several Linux distributions:

Minimum hardware requirements:

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

Recommended hardware configuration:

  • 1GB + RAM
  • 50GB + disk space

Software requirements:

To install Jenkins on your CentOS, you can follow the following steps.

Step 1: Install java

Jenkins is a Java application, so we need to install Java before installing Jenkins. You run the following command to install the OpenJDK 8 package.

AZDIGI Tutorial
yum install java-1.8.0-openjdk-devel -y
    
How to install Jenkins on CentOS 7

Step 2: Setup Jenkins repository

Next, you need to enable the Jenkins repository with the following command:

AZDIGI Tutorial
curl --silent --location http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo | sudo tee /etc/yum.repos.d/jenkins.repo
    
How to install Jenkins on CentOS 7

And add the repository to your system with the command:

AZDIGI Tutorial
rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key  

Step 3: Install Jenkins

Once the repository is enabled, let’s install the latest stable version of Jenkins with the following command:

AZDIGI Tutorial
yum install jenkins -y  

After completing the installation, start the Jenkins service:

AZDIGI Tutorial
systemctl start jenkins

To check if Jenkins has run successfully, use the following command:

AZDIGI Tutorial
systemctl status jenkins
How to install Jenkins on CentOS 7

Finally, enable the Jenkins service to start with your system.

AZDIGI Tutorial
systemctl enable jenkins
How to install Jenkins on CentOS 7

Step 4: Configure Firewalld

The default port of Jenkins is 8080, so if your VPS is using Firewall, you need to enter the port with the following commands:

AZDIGI Tutorial
firewall-cmd --permanent --zone=public --add-port=8080/tcp
firewall-cmd --reload
How to install Jenkins on CentOS 7

Step 5: Set up Jenkins

To set up the Jenkins installation, open your browser => enter the IP address and port 8080.

http://your_ip:8080

The screen will appear the interface as below, you need to enter the Administrator password that was created during the installation process:

How to install Jenkins on CentOS 7

To get the Administrator password, run the following command:

AZDIGI Tutorial
cat /var/lib/jenkins/secrets/initialAdminPassword

You will see a password consisting of letters and numbers as shown below:

How to install Jenkins on CentOS 7

You copy this password and paste it into the Administrator password box => click Continue in the browser to continue the setup steps.

How to install Jenkins on CentOS 7

Next, you will be asked if you want to install recommended plugins or choose specific ones. Click Install suggested plugins and the installation will begin immediately.

How to install Jenkins on CentOS 7

How to install Jenkins on CentOS 7

You will be prompted to set up an administrative user. You need to fill in all the required information => click Save and Continue.

How to install Jenkins on CentOS 7

On the next page, you will be asked to set the URL for Jenkins, the URL part will be populated automatically. To confirm the URL, click the Save and Finish button.

How to install Jenkins on CentOS 7

Continue to click Start using Jenkins to complete the setup.

How to install Jenkins on CentOS 7

Finally, open Terminal and run the following command to restart Jenkins:

AZDIGI Tutorial
systemctl restart jenkins

After restarting Jenkins, go to http://your_ip_or_domain:8080/, log in with the admin account you created and you will be redirected to the Jenkins admin page.

How to install Jenkins on CentOS 7

After successful login, you will have the Jenkins interface as shown below:

How to install Jenkins on CentOS 7

III. Summary

Thus, AZDIGI has shown you how to install Jenkins on Centos 7 server with just a few simple command lines. You can now visit the Jenkins documentation page to start discovering how to use and the cool features of Jenkins at the link: https://www.jenkins.io/doc/

. Hopefully, this article will help you to install Let’s Encrypt SSL successfully!

If you find the article helpful, please share it widely. In addition, you can check out some other articles about VPS at the link below:

If you need assistance, you can contact support in the ways below:

Đánh giá

Tham gia nhóm hỗ trợ Server - Hosting

Tham gia nhóm Hỗ trợ Server - Hosting & WordPress để cùng nhau hỏi đáp và hỗ trợ các vấn đề về WordPress, tối ưu máy chủ/server.

Tham gia ngay

Bài viết cùng chuyên mục

AZDIGI – Không chỉ là đơn vị hàng đầu trong lĩnh vực Web Hosting và Máy chủ, chúng tôi mong muốn mang lại những kiến thức bổ ích nhất và luôn cập nhật thường xuyên cho cộng đồng người đam mê thiết kế website, công nghệ,…

Vui lòng không sao chép nội dung nếu chưa xin phép. Designed and Developed by PenciDesign