+
Jenkins is one of the most popular tools DevOps tools,originally designed with one purpose in mind: be a great build automation server. It’s free and open-source, built for developers, and has lots and lots of plugins that you can configure to build anything.
Although Jenkins can be deployed to lots of public clouds likeAWS, GCP or Azure, running a local Jenkins server still has its own advantages and values. Speeds and easy for experimentation are just two of the most important ones.
WindowsSubsystem for Linux
The Windows Subsystem for Linux (WSL) letsdevelopers run a GNU/Linux environment -- including most command-line tools, utilities, and applications -- directly on Windows, unmodified, without the overhead of a traditional virtual machine or dual-boot setup.
WSL 2 isa new version of the Windows Subsystem for Linux architecture that powers the
Windows Subsystem for Linux to run ELF64Linux binaries on Windows. Its primary goals are toincrease file system performance, as well as adding full system call
compatibility.
Install WSL2 on Windows
For the full instructions to install WSL2 on windows, referto this one
Let's begin: Install Jenkins in Windows Subsystem for Linux
- Open a terminal in Windows
- Open a new Ubuntu terminal (I am using Windows Terminal, but youcan use whatever terminal tools like blow excellent candidates)
Update Ubuntu in WSL2
Below here are the quick scripts for updating Ubuntuin WSL2:
Install Java and Jenkins in WSL2
You will get an error like below:
To solve this, run the below script:
With this, ~ 68MB Jenkins package will be downloaded,it will take a while depending on the internet speeds.
Update Firewall to enable Jenkins service
Run Jenkins server
sudo service jenkins start
InstallJenkins from a browser
Navigate to your host browser, and type: http://localhost:8080/
You will see the screen as below:
where you will be prompted to provide an initialpassword to unlock Jenkins.
Follow up the screen instructions and in theterminal, type below: sudocat /var/lib/jenkins/secrets/initialAdminPassword
- Copy the password you retrievedto clipboard
- Return to the host browserwindow, and paste the password therein
- Click "Continue"button !!
Follow the screen instructions to create an account!!