How to Install Jenkins on Windows Server 2025
Jenkins is one of the most widely used open-source automation servers in the world, enabling continuous integration and continuous delivery (CI/CD) pipelines across virtually every technology stack. Running Jenkins on Windows Server 2025 gives teams a familiar environment for building, testing, and deploying .NET applications, PowerShell-driven automation, and hybrid workloads. This guide walks through a complete Jenkins installation on Windows Server 2025, from installing the Java runtime to configuring build agents and email notifications.
Prerequisites
- Windows Server 2025 (Standard or Datacenter) with administrator access
- At least 4 GB RAM and 20 GB free disk space for Jenkins home
- An outbound internet connection for downloading packages (or internal mirrors)
- Windows Firewall access to open TCP port 8080
- PowerShell 5.1 or later (included with Windows Server 2025)
Step 1: Install OpenJDK 17
Jenkins requires a Java runtime. The current LTS release of Jenkins mandates Java 17 or Java 21. OpenJDK 17 from Microsoft or Eclipse Temurin are both reliable choices on Windows Server 2025. The following PowerShell commands download and install Microsoft’s build of OpenJDK 17:
# Download Microsoft OpenJDK 17 MSI
$jdkUrl = "https://aka.ms/download-jdk/microsoft-jdk-17-windows-x64.msi"
$jdkInstaller = "$env:TEMPmicrosoft-jdk-17.msi"
Invoke-WebRequest -Uri $jdkUrl -OutFile $jdkInstaller
# Silent install
Start-Process msiexec.exe -ArgumentList "/i `"$jdkInstaller`" /qn ADDLOCAL=FeatureMain" -Wait
# Verify installation
java -version
After installation, confirm the output reads openjdk version "17.x.x". If the java command is not found, log out and back in so the updated PATH environment variable takes effect, or set it manually:
[System.Environment]::SetEnvironmentVariable(
"JAVA_HOME",
"C:Program FilesMicrosoftjdk-17",
[System.EnvironmentVariableTarget]::Machine
)
$env:PATH += ";$env:JAVA_HOMEbin"
Step 2: Download the Jenkins Windows Installer
Navigate to jenkins.io/download and select the Windows package under the LTS column to download jenkins.msi. Alternatively, use PowerShell:
# Download Jenkins LTS MSI
$jenkinsUrl = "https://get.jenkins.io/windows-stable/latest/jenkins.msi"
$jenkinsMsi = "$env:TEMPjenkins.msi"
Invoke-WebRequest -Uri $jenkinsUrl -OutFile $jenkinsMsi
Step 3: Install Jenkins as a Windows Service
Run the MSI installer from an elevated PowerShell prompt. During the GUI-based installation wizard you will be prompted for a service account. Best practice is to create a dedicated domain or local account rather than running under SYSTEM, so Jenkins has appropriately scoped permissions.
# Create a dedicated local Jenkins service account
$securePass = ConvertTo-SecureString "P@ssw0rd!Jenkins25" -AsPlainText -Force
New-LocalUser -Name "svc-jenkins" `
-Password $securePass `
-FullName "Jenkins Service Account" `
-Description "Runs Jenkins CI server" `
-PasswordNeverExpires
# Add to local administrators group (scope as needed)
Add-LocalGroupMember -Group "Administrators" -Member "svc-jenkins"
# Silent install with dedicated account
Start-Process msiexec.exe -ArgumentList `
"/i `"$jenkinsMsi`" /qn JENKINS_SERVICE_USER=svc-jenkins JENKINS_SERVICE_PASSWORD=P@ssw0rd!Jenkins25" `
-Wait
The installer registers Jenkins as a Windows service named Jenkins, sets the Jenkins home directory to C:ProgramDataJenkins.jenkins, and starts the service on port 8080.
# Confirm the service is running
Get-Service -Name Jenkins
# Open firewall for Jenkins web UI
New-NetFirewallRule -DisplayName "Jenkins HTTP" `
-Direction Inbound `
-Protocol TCP `
-LocalPort 8080 `
-Action Allow
Step 4: Initial Admin Setup — Unlock Jenkins
On first launch Jenkins generates a one-time unlock key. Retrieve it before opening the web UI:
# Read the initial admin password
Get-Content "C:ProgramDataJenkins.jenkinssecretsinitialAdminPassword"
Open a browser and navigate to http://<server-ip>:8080. Paste the password from the file above into the Unlock Jenkins field and click Continue.
Step 5: Install Suggested Plugins
On the Customize Jenkins screen choose Install suggested plugins. Jenkins will install the most commonly used plugins including Git, Pipeline, Blue Ocean, Credentials Binding, and Workspace Cleanup. For Windows-centric shops also install:
- MSBuild — for building Visual Studio solutions
- PowerShell — allows PowerShell build steps natively
- NUnit or MSTest — for .NET test result parsing
- Active Directory — integrate with AD for SSO
Step 6: Create the First Admin User
After plugin installation the wizard prompts you to create the first administrator account. Fill in a username, password, full name, and email address, then click Save and Continue. Avoid using the built-in admin username so that auditing remains meaningful.
Step 7: Configure the Jenkins Home Directory
The Jenkins home (JENKINS_HOME) defaults to C:ProgramDataJenkins.jenkins. This directory stores all jobs, build histories, plugin data, and credentials. On production servers move it to a dedicated data volume:
# Stop Jenkins before moving home
Stop-Service Jenkins
# Move Jenkins home to D:Jenkins
Move-Item "C:ProgramDataJenkins.jenkins" "D:Jenkinshome"
# Update the environment variable
[System.Environment]::SetEnvironmentVariable(
"JENKINS_HOME",
"D:Jenkinshome",
[System.EnvironmentVariableTarget]::Machine
)
# Edit jenkins.xml to reflect new home path
(Get-Content "C:Program FilesJenkinsjenkins.xml") `
-replace "C:\ProgramData\Jenkins\.jenkins", "D:\Jenkins\home" |
Set-Content "C:Program FilesJenkinsjenkins.xml"
Start-Service Jenkins
Step 8: Configure Build Agents (Controller vs Agent Architecture)
For scalability, Jenkins separates the controller (scheduling, UI) from agents (build execution). To add a Windows agent node navigate to Manage Jenkins → Nodes → New Node. Choose Permanent Agent and configure the launch method as Launch agent by connecting it to the controller (JNLP/WebSocket). On the agent machine run:
# On the agent machine — download agent.jar from the controller
$agentJar = "$env:TEMPagent.jar"
Invoke-WebRequest -Uri "http://jenkins-controller:8080/jnlpJars/agent.jar" -OutFile $agentJar
# Run the agent (replace SECRET and NAME with values from the Jenkins UI)
java -jar $agentJar `
-url http://jenkins-controller:8080/ `
-secret "abc123yoursecret" `
-name "win-agent-01" `
-workDir "D:Jenkinsagent-workspace"
To run the agent as a Windows service, wrap it with NSSM (Non-Sucking Service Manager) or use the Windows Service Wrapper (WinSW) that Jenkins bundles.
Step 9: Using PowerShell in Jenkins Build Steps
With the PowerShell plugin installed, add a Windows PowerShell build step to any freestyle job, or use the powershell directive in a Jenkinsfile:
pipeline {
agent { label 'windows' }
stages {
stage('Build') {
steps {
powershell '''
Write-Host "Running on $env:COMPUTERNAME"
dotnet build MyApp.sln --configuration Release
'''
}
}
stage('Test') {
steps {
powershell '''
dotnet test MyApp.Tests --logger trx --results-directory TestResults
'''
}
}
}
post {
always {
mstest testResultsFile: 'TestResults/*.trx'
}
}
}
Step 10: Configure Email Notifications
Navigate to Manage Jenkins → System → E-mail Notification. Fill in your SMTP server details. For Microsoft 365 SMTP relay:
- SMTP server: smtp.office365.com
- Port: 587
- Use SSL: checked (STARTTLS)
- SMTP Authentication: enabled with a service account
For advanced templates install the Email Extension (email-ext) plugin and configure post-build actions per pipeline:
post {
failure {
emailext(
subject: "BUILD FAILED: ${env.JOB_NAME} #${env.BUILD_NUMBER}",
body: "Check console output at ${env.BUILD_URL}",
to: "[email protected]"
)
}
}
Conclusion
Jenkins on Windows Server 2025 provides a mature, extensible CI/CD platform that integrates naturally with Windows-native toolchains including MSBuild, PowerShell, and Active Directory. By installing Java 17, configuring a dedicated service account, separating the controller from build agents, and enabling email notifications, you have a production-ready Jenkins environment capable of scaling from a single server to a distributed fleet of Windows build nodes. As a next step consider configuring role-based access control (RBAC) via the Role Strategy plugin and enabling HTTPS by placing Jenkins behind an IIS or Nginx reverse proxy with a valid TLS certificate.