In this article, we will go through the steps to download and install Jenkins on Windows. Jenkins is a free and open-source automation software used for building, testing, and deploying code to achieve the end goal of Continuous Delivery and Continuous Integration. It provides faster and more efficient code deployment in multiple environments. Jenkins supports a wide range of plugins due to which it can deploy almost any kind of code to any environment.
What is Jenkins?
Jenkins is a self-contained, open source (DevOps tool) automation server which can be used to automate all sorts of tasks related to building, testing and delivering or deploying software. Jenkins can be installed through native system packages, Docker, or even run standalone by any machine with a Java Runtime Environment (JRE) installed.
Jenkins may be installed on either Windows/Unix/supported platforms, but we will focus only install Jenkins on a Windows machine in the article (the below steps explain the installation in the standalone machine).
STEP 1: Prerequisites
Before you proceed to install Jenkins in your windows/Unix system, there are some prerequisites for Jenkins to install Jenkins on your computer.
Hardware requirements:
- Hardware requirements (Minimum): 256 MB of RAM, 1 GB of drive space (although 10 GB is a recommended minimum if running Jenkins as a Docker container)
- Hardware configuration for a small team (Recommended) : 4 GB+ of RAM & 50 GB+ of drive space
Software Requirements:
- You should have the latest Java software installed as a prerequisite. Since Jenkins runs on Java, you need either the latest version of Java Development Kit (JDK) or Java Runtime Environment (JRE).
- You should have access to install Software on Windows Server.
You can refer to the prerequisites of Jenkins in Jenkins.io
STEP 2: Choose the type of Jenkins download
Jenkins releases two types of versions based on the organization’s needs. The first one is the Long-term support release & Weekly release. First, you need to download the latest Jenkins software from Download Page. At the time of writing this article, Jenkins 2.289.3 is the latest version. This might be different for you.
Long-term support releases are available every 12 weeks. They are stable and are widely tested. This release is intended for end users.
Weekly releases are made available every week by fixing bugs in its earlier version. These releases are intended towards plugin developers.
For this article, we will use the LTS, and more of the steps will remain the same for the Weekly release.
STEP 3: Download the Jenkins tool
First you need to download the latest Jenkins software from Download Page. At the time of writing this article, Jenkins 2.346.2 is the latest version (May you will find the different version during your time).
STEP 4: Double-click on Downloaded setup
Go to download location from the local computer (unzip) and Double-click on jenkins.msi. You can also Jenkin using a WAR (Web application archive) but that is not recommended.
STEP 5: In the Jenkin Setup screen, click Next.
STEP 6: Choose the Installation location
Choose the location where you want to have the Jenkins instance installed (default location is C:\Program Files (x86)\Jenkins), then click on the Next button.
STEP 8: Service Logon
You need to provide user account credentials to run Jenkins as Independent Windows Service. These can be done using two different ways – run service as LocalSystem or run service as local or domain user. Usually, it is recommended to use a local or domain user to run the Jenkins Service but here we will run the service as LocalSystem. Then Click on Next.
STEP 9: Choose your port
By default Port 8080
will be used for running Jenkins Service but you can always change this port as per your need. Once port detail is given you can quickly check its availability by clicking on Test Port
. If testing goes successful then Click on Next
.
SETP 10: Select Java Home Directory
Since Jenkins requires Java Runtime Environment to run so here you need to provide the JRE path to proceed with the installation.
STEP 11: Choose a Custom setup
If you want to install any other features during the installation process then you can select them from here and click on Next
. You can also select and install other features post-Jenkins Installation.
STEP 12: Start the installation
If you see the below window then it means Jenkins is finally ready to install. You can now just click on Install
to begin the installation process.
Post-installation you can verify the Jenkins service is running in the services. If you have any separate service account then you can choose “Run service as local or domain user” option during STEP 8 and provide the service account username &password instead of “run service as LocalSystem”.
Step 13: Unlock Jenkins
Type http://localhost:portno (here I configured with 8080 during the installation) in the browser. To ensure Jenkins is started securely by an administrator account, a password is written on C:\Windows\system32\config\systemprofile\AppData\Local\Jenkins\.jenkins\secrets\initialAdminPassword file needs to be given in the below screen to Continue.
Step 14: Choose the Customize Jenkins
You can choose either “Install suggested plugin” or “Select Plugins to install ” ( this option will not install any plugin and you can install based on your organization’s needs). For my setup, I have chosen the first option.
Step 15: Create an Admin User
You can also create an admin user account in case you don’t want to proceed as an admin. Here we are creating a user cyber hub and going to use the same for accessing Jenkins Server. In case you don’t want to create any user, you can click on Skip and continue as admin.
Step 16: Instance Configuration
Then you need to set up the Jenkins URL below Window. Here we will use the below default URL. So we leave it as it is and then click on Save and Finish.
Step 17: Using Jenkins in the browser
You will see a Jenkins Dashboard like below logged in with cyberithub account and now you can start creating your Job.