Learnitweb

Install Jenkins using the war file on Windows

1. Install Java

  • Jenkins requires Java 11 or Java 17.
  • Download from: https://www.oracle.com/java/technologies/javase-downloads.html
  • After installation, set the JAVA_HOME environment variable:
  • Search for Environment Variables in the Start Menu.
  • Under System Variables, click New.
  • Variable name: JAVA_HOME
  • Variable value: C:\Path\To\Your\Java (e.g., C:\Program Files\Eclipse Adoptium\jdk-17)
  • Verify Java Installation
java -version

2. Download Jenkins WAR File

  • Visit the Jenkins website: https://www.jenkins.io/download/
  • Scroll to Generic Java package (.war) and click Download.
  • Save the file (e.g., jenkins.war) in a convenient directory like C:\Jenkins.

3. Run Jenkins WAR

Open Command Prompt and navigate to the directory where you saved the .war file:

cd C:\path\to\jenkins\folder

Run Jenkins:

java -jar jenkins.war

This starts Jenkins on the default port 8080.

4. Get Admin Password

After Jenkins starts, it will output something like this in the console:

Please use the following password to proceed to installation:
3fd56c38ef9e48bb9d46baf99a0d9182

Alternatively, open the file:

C:\Users\<your-user>\.jenkins\secrets\initialAdminPassword

5. Access Jenkins in Browser

Open your browser and go to:

http://localhost:8080

Paste the admin password from above and proceed with setup.

6. Optional: Start Jenkins on a Different Port

If port 8080 is in use, specify a different one:

java -jar jenkins.war --httpPort=9090

7. Setup Wizard

7.1 Install suggested plugins

Let Jenkins install the most common and useful plugins.

7.2 Create Admin User

Fill in the form to create your admin user:

  • Username
  • Password
  • Full name
  • Email

Click Save and Continue.

7.3 Instance Configuration

Confirm the Jenkins URL (default is http://localhost:8080). You can update this later if needed.

Click Save and Finish.