In this article , We will learn how to install and configure Jenkins on Centos 7.
In my previous article , I have explained How to implement a plugin to automatically create a backup of Jenkins. Check this article.
What is Jenkins?
- Jenkins is an open source continuous integration server , which is written in java.
- It is used to automate the tasks which we run it manually as a everyday tasks.
- It is used to deploy applications into the server automatically whenever commit occurs Which is also known as Continuous Integration and Delivery mechanism.
- You need an running Centos server , Or , You can create an EC2 Instance using AWS Console , Refer this article
- Make sure you have sudo or root privileges to the server for jenkins installation.
Jenkins requires java to work. Lets see how to install the java packages in the Centos Operating system.
First , Open the terminal on the Centos server
Using the below command install the java,
yum install java-1.8.0-openjdk.x86_64 -y
Once the installation is completed , Issue the below command , To check the Java version Installed on the system.
Now Lets go ahead and Install Jenkins on Centos 7.
The default repository of the System will have the outdated version of Jenkins.
To install the latest version of Jenkins with the latest features and fixes , We are going to add the latest Jenkins repository to the server.
Adding the key and the Jenkins repository to the system using the below commands.
sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
Install the jenkins package using the below command.
yum install jenkins
Once the Jenkins is successfully installed on the server , Start the Jenkins service using the below command.
sudo systemctl start jenkins
To check the status of the Jenkins ,Use the below command,
sudo systemctl status jenkins
To start the jenkins service automatically on system boot , Enable the Jenkins service using the below command.
sudo systemctl enable jenkins
Now that We have Jenkins service Installed and running Successfully.
By default , Jenkins runs on the port 8080.
Make sure you have whitelisted the port 8080 in the firewall or If you’re using EC2 instance to host Jenkins , Allow port 8080 in the security group.
To setup Jenkins , We have to access the Jenkins dashboard on the port 8080 using the
http://server’s IP Address:8080
You will see the following page.
You can get the administrator password in the below mentioned file , Using the below command.
Copy and paste the password and then click Continue
Next You will asked to Customize Jenkins ,
Click Install suggested plugins , Which will start the installation process
Once the installation is completed , You will asked to create an admin user.
We can skip this process and login to Jenkins as admin using the initial password , But Let us create our first admin user and manage Jenkins using this user.
Fill in the details and click Save and Continue
You can configure the root URL for Jenkins , Click Save and Finish.
Now the Jenkins setup is completed and It is ready to use.
Click Start using Jenkins , You will be taken to the Main Jenkins dashboard.
We have successfully Installed and configured Jenkins on Centos 7.
Hope this article helps. Thanks for referring this article.
Check out my other articles.