Nội dung
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:
- Java: see the Java Requirements page
- Web browser: view browser compatible page
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.
yum install java-1.8.0-openjdk-devel -y
Step 2: Setup Jenkins repository
Next, you need to enable the Jenkins repository with the following command:
curl --silent --location http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo | sudo tee /etc/yum.repos.d/jenkins.repo
And add the repository to your system with the command:
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:
yum install jenkins -y
After completing the installation, start the Jenkins service:
systemctl start jenkins
To check if Jenkins has run successfully, use the following command:
systemctl status jenkins
Finally, enable the Jenkins service to start with your system.
systemctl enable jenkins
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:
firewall-cmd --permanent --zone=public --add-port=8080/tcp firewall-cmd --reload
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:
To get the Administrator password, run the following command:
cat /var/lib/jenkins/secrets/initialAdminPassword
You will see a password consisting of letters and numbers as shown below:
You copy this password and paste it into the Administrator password box => click Continue in the browser to continue the setup steps.
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.
You will be prompted to set up an administrative user. You need to fill in all the required information => click Save and Continue.
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.
Continue to click Start using Jenkins to complete the setup.
Finally, open Terminal and run the following command to restart Jenkins:
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.
After successful login, you will have the Jenkins interface as shown below:
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:
- Hotline 247: 028 888 24768 (Ext 0)
- Ticket/Email: You use the email to register for the service and send it directly to: support@azdigi.com