Articles → DevOps → Install Jenkins On Linux Machine

Install Jenkins On Linux Machine






Steps




  1. Login to the linux server either using putty or the MobaXTerm.
  2. Switch to the root user role by using the following command.
  3. sudo -i


  4. Execute the following command.
  5. sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo


    Picture showing getting the jenkins package using wget command

    Click to Enlarge

  6. Post that, execute the following commands.
  7. sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
    yum install jenkins


  8. Once the above command is executed, check if the jenkins service is enabled or not. We can use the following command.
  9. service jenkins status


    Picture showing the service command to check the status of the service

    Click to Enlarge



    service jenkins start


    Picture showing the execution of service jenkins start command for starting the service

    Click to Enlarge

  10. As the Jenkins is using the 8080 port. So, we have to enable it in Azure. For that, go to the virtual machine and add an inbound port in the "Network" menu.
  11. Picture showing enabling 8080 port in azure portal

    Click to Enlarge

  12. Finally open the Putty.
  13. Enter either the Host Name Or the IP address.
  14. Picture showing opening the putty for entering the server credentails

    Click to Enlarge

  15. Go to the "Connection" → "SSH" → "Tunnels".
  16. Enter the source port as 8080 and Destination as 127.0.0.1:8080 and click on the "Add" button.
  17. Picture showing adding the source and destination port as 8080

    Click to Enlarge

  18. Finally click on the "Open" button to connect to the server.
  19. A screen will appear to enter the username and password.
  20. Now, you can open the following URL. A page will appear to enter the administrator password.
  21. http://localhost:8080/


    Picture showing the screen to unlock jenkins

    Click to Enlarge

  22. To get the password, you have to execute the following command.
  23. cat /var/lib/jenkins/secrets/initialAdminPassword


    Picture showing the jenkins password in initialAdminPassword file

    Click to Enlarge

  24. Paste the password and click on the "Continue" button.
  25. Another screen will appear where you can click on the "Install Suggested Plugins" button.
  26. Picture showing the jenkins screen allows to install the suggested plug-ins

    Click to Enlarge

  27. All plugins are installed.
  28. Picture showing plug-ins installation in progress

    Click to Enlarge

  29. Another screen will appear where you can create the admin user. Enter the details and click on the "Save and Continue" button.
  30. Picture showing a jenkins screen for creating a new user account

    Click to Enlarge

  31. Another screen will appear to configure the instance configuration. Click on the "Save and Finish" button.
  32. Picture showing a screen to configure the instance configuration

    Click to Enlarge




Picture showing the screen that displays the installation completion of jenkins

Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Saturday, November 28, 2020

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250