Prerequisite
Jenkins controller: Ubuntu 22 on AWS EC2
On Controller (Ubuntu Jenkins)
-
Port 8080 open
-
Port 50000 open
-
-
New agent: Windows Server (or Windows 10/11)--Lunch a new windows instance.
1. Prep the Windows machine
On the Windows box (the future agent):
-
Install Java (same major as controller, e.g. JDK 17 or 21)
-
Download a JDK (Temurin, Oracle, etc.) in the agent through the browser
-
Install to something like:
C:\Program Files\Java\jdk-21
-
-
Add Java to PATH (optional but helpful)
-
System Properties → Advanced → Environment Variables
-
Under System variables, edit
Path→ add:
C:\Program Files\Java\jdk-21\bin
-
-
Create a Jenkins work directory
-
For example:
C:\jenkins -
Make sure the user that will run the agent (e.g.
jenkinsor your login) has full rights. -
Network
-
Windows server must be able to reach the Jenkins URL over HTTP/HTTPS
-
If using inbound TCP agent port (default 50000), make sure it’s open on security group if needed
2. Create the Windows node in Jenkins
On the Jenkins controller UI:
-
Go to Manage Jenkins → Nodes (or “Manage Nodes and Clouds”).
-
Click New Node.
-
Name it e.g.
windows-agent-1. -
Choose Permanent Agent → OK.
Fill in:
-
# of executors:
1(or more if the box is strong) -
Remote root directory:
C:\jenkins -
Labels: e.g.
windows maven(you’ll use these in jobs) -
Usage: “Use this node as much as possible”
Launch method (very important)
Set Launch method to:
Launch agent by connecting it to the controller
This means the Windows machine will run java -jar agent.jar and connect in.
Click Save.
You’ll now see the node page with instructions like “Launch agent”, “jnlp” etc.
Your Agent is now connected