To install Jenkins on a Windows machine, follow these steps:

Step 1: Download Jenkins

  1. Go to the official Jenkins website: Jenkins Downloads.
  2. Choose Windows as the platform and download the latest Jenkins Windows Installer (MSI).

Step 2: Install Java (if not installed)

Jenkins requires Java to run. Ensure that you have the latest Java Development Kit (JDK) installed:

  1. Download JDK from Oracle's official page or use OpenJDK from AdoptOpenJDK.
  2. Install JDK and set the JAVA_HOME environment variable to the JDK installation path:
    • Go to System Properties > Advanced > Environment Variables.
    • Under System Variables, click New or Edit.
    • Set JAVA_HOME to the JDK directory (e.g., C:\Program Files\Java\jdk-11).

Step 3: Install Jenkins

  1. Run the downloaded Jenkins installer (MSI file).
  2. Follow the installation wizard:
    • You can choose the default settings for most options.
    • Select the path for Jenkins installation or leave it to the default (C:\Program Files\Jenkins).
    • Let Jenkins install as a Windows service (default option).
  3. After installation, Jenkins will start as a Windows service.

Step 4: Initial Setup

  1. Open your browser and go to http://localhost:8080. Jenkins will ask you for an initial admin password.
  2. Find the password in the following location: C:\Program Files\Jenkins\secrets\initialAdminPassword.
  3. Copy the password from the file and paste it into the browser to unlock Jenkins.

Step 5. Complete the Setup

Follow the on-screen instructions to:

  1. Install recommended plugins.

Select Install Suggested plugins--

  1. Create an admin user:

After the plugin setup is complete, Jenkins will prompt you to create an administrator user. Fill in the details in the respective fields and click on Save and Finish. Take a look at this screenshot:

s

Now Jenkins will be fully operational on your windows machine and can only be accessed through valid credentials.

Step 6: Configure Jenkins Service (Optional)

To manage Jenkins as a Windows service:

  • Open Services (press Win + R and type services.msc).
  • Find Jenkins in the list, right-click, and you can start, stop, or restart the service from there.