Installing Jenkins for my CI/CD

This is more of a guide for the process I went through for setting up Jenkins for my CI/CD. The following steps are only about setting up Jenkins itself and does not include subsequent configuration required for the jobs themselves.

User Setup

  1. Create a user in Computer Management named JenkinsUser, set the password, and mark it as Password Never Expires (you’ll need to save the password for later).
  1. Create a Service Users group and add JenkinsUser to it (I expect to use this group in the future for other users for other services).
  1. Configure the JenkinsUser to log in as a service:

Start Menu ⇾ Local Security Policy ⇾ Local Policies ⇾ User Rights Assignment ⇾ Log on as a service ⇾ Add User or Group ⇾ Add the Service Users group.

Installing Jenkins

  1. During the Jenkins installation, set the user to the <MachineName>\JenkinsUser (<MachineName> for me is tor-vm-jenkins) and test the login.
  1. During installation, I enabled the firewall exception so I can access Jenkins from other machines.
  2. To access the Jenkins service, you can go to the Start Menu ⇾ services.msc, and search for Jenkins and make sure it is started.
  3. Go to http://127.0.0.1:8080/ and do the initial setup of the Jenkins service:
  1. Go to the file listed and get the initial password to start.
  2. At the plugin installation page I like to add a few additional plugins. These were the ones I selected:
    1. Build Name and Description Setter
    2. Rebuilder
    3. Throttle Concurrent Builds
    4. MSBuild
    5. Github
  3. Set up your Jenkins Admin user (save the password somewhere).
  1. Set the instance configuration: this is the URL Jenkins will generate for absolute links for Jenkins resources so they can be shared. In the case of being part of an internal domain, or even externally accessible, you’ll want the fully qualified domain name and port.

Jenkins User Restart Permissions

There is one subtle extra step for configuring Jenkins on Windows.

The Jenkins User for the service doesn’t have rights to restart the service which Jenkins will want to do when changing plugins or doing other major operational changes that require it. To make the Jenkins User able to restart the Jenkins service itself, the following steps are required:

  1. Install Process Explorer (this can be useful in the future for more complicated builds that can get hung, or to investigate file access/handle issues): https://docs.microsoft.com/en-us/sysinternals/downloads/process-explorer
  2. Run ProcExp64.exe (you may need to explicitly run this as administrator)
  3. Find Jenkins.exe (you can use the process name search in the upper right corner)
  1. Right-click on Jenkins.exe ⇾ Properties ⇾ Services Tab ⇾ Permissions button ⇾ Add the Jenkins User and give it full rights.
  1. To ensure this works, you can go to the Jenkins safe restart page at http://127.0.0.1:8080/safeRestart and try it.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.