How to Install Jenkins on Windows

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
how to install jeans on windows [Music] although it is recommended that you install jenkins controllers on linux-based servers not everybody uses linux that's shocking right there are a number of shops that are still microsoft windows only windows is fully supported and widely used but there are complications in windows environments like the file system locking semantics that make it more difficult to run a controller on windows fortunately it is still possible to install and configure jenkins controllers on windows servers here's today's starting point i have a windows server specifically i have a windows server 2022 i just happen to be hosting this on aws but whether you're self hosting or using cloud hosted vms the steps in this video should apply to any version of windows the first thing that we're going to need to do is install java and specifically the jdk so inside of edge here i already have adopteum.net opened up and i'm going to download tamarin 11 because at this point jenkins only runs with either jdk 8 or jdk 11. so i'm going to select the latest release and let that download into my downloads folder and that will take just a moment and then i'm also going to go ahead while we're here and downloading things let's go ahead and download jenkins so i'm going to say jenkins.io click on download and then i'm going to stick with the lts version and i'm going to select windows and then that automatically starts downloading there as well and it's almost finished and now all of our downloads are done and that's great so now we can go ahead and get started installing so let's go over to our downloads folder and let's take a look at the files that we have let me go ahead and minimize edge there we go so first off let's go ahead and install jdk 11 and also remember you want to install the jdk and not the jre so we'll get the jdk we'll do the installation click on next and we're going to make a couple of small changes here actually just one we're going to set the java home variable so we will do that so jdk with hotspot is on add to path is on associate jar is on set java home is on and then the javasoft oracle is off and like i said there is i said one but there's really two i want to go ahead and change the location of our installation now this is up to you this is what i like doing so i'm going to say c uh here we go tools slash jdk and let's get the right slash there so it's c tools jdk i like installing all of my tooling inside of a tools directory you may have your own preferences i'm just following what i like to do so see tools jdk and then the jdk specific version here so we'll click on ok and so all that still looks good location looks good we'll click on next click install this will take just a few seconds and then once this is complete we'll double check a few other things okay that's done we'll click on finish so that installation for the jdk is done however the configuration is not complete yet we want to modify our environment variables java home and path so let's go ahead and go down here and type environment and then what we will get env edit the system environment variables and click on environment variables and what we want to modify is java home the first thing that we want to do on the java home is we want to remove the trailing slash so it's just going to be c tools jdk jdk 11 hot spot no trailing slash and then in our path what we want to do is we want to modify our path to change this to reference the java home environment variable so we'll get rid of hotspot and replace that with java underscore home i think that looks good yup java underscore home bin yep so we'll click on ok that looks fine and we will click on ok so let's go and open up a command prompt and let's take a look at our values so for java dash version we have our jdk version that's right let's go ahead and echo out our java home value which is that and also echo out whoops echo out our path and that also looks correct now to get ready to install jenkins one of the things that we're going to need is an account that has the ability to log on as a service and in my example today i'm going to be using the administrator account which which is how i'm logged into this server you might want to set up a standard user account that you are using to manage your services but for my example today i'm just using administrator and the way that we do that is we're going to open up local system policy so i'm going to look for local security policy excuse i'll me ahead and close this while that's coming up and once local security policy opens up what we want to do here is we're going to click on local policies and then we're going to click on user rights assignments and from here what we want to do is go down to log on as a service so log on as a service and we can see here entity service all services we need to add a user or a group and right now what i want to do is i want to add administrator and we click on check names and then it resolves out the full name that's okay click on ok now we can see that the administrator user has been added we'll click on apply and click on ok now we're ready to install jenkins so let's go back over to our downloads directory we'll close these up first and we'll double click on jenkins we're going to click on next and again much like what i did with the jdk i'm going to put this into a different directory this is tools oops i forgot the slash so let's get the slash back there we go tools jenkins that's good next now we're going to run the service as a local or domain user which we are so in this case my account is administrator and my password i need to go copy here we go grab my password i'm going to paste this in and i'm going to click on test credentials and if it's successful we get a green check mark so so far so good click on next we're going to leave the default port number of 8080. we're still going to test the port to make sure it's fine and it is click next we're going to select the path of our jdk which this is the path for our jdk so it's already aware of that we'll click on next and here when we click on next we do not want the service to start up automatically because we're going to be making some more configuration changes before we actually start the service so i'm going to say unavailable for start service so start service is off firewall exception is off let's click on next so now we're ready to go and click on install this will take just a couple of seconds and now we're done and we'll click on finish now there's a few more steps that we need to do in order to configure jenkins before we actually do the startup so i'm going to go back over to where it was installed which in our case was in c tools jenkins so c tools jenkins we can see we have a handful of files here but the file that we want to modify first is our jenkins xml so if we go ahead and modify this file we'll say edit i'll slide this over here a little bit a handful of things we want to change first off again deciding where we want our files to live is an important thing so i want to control where my jeacon's home directory is which is where all of the data will live so i'm going to say c data jenkins underscore oops jenkins underscore home my choice that's where i wanted to live for the executable i want to change this to be my java home environment variable you could choose to not use the java home environment variable you could have a specific version of java that you include here again completely up to you i'm making the choice that i want to use the java home version of java that is on this machine and then for arguments i'm going to make a few changes here first off we have 256 meg that's going to be way too small so i'm going to go ahead and copy over some values that i already have ready to go here so i'm going to replace my xmx with a bunch of configurations so first off i'm setting my min and max to 3 gig i'm setting headless to true i'm preferring ipv4 over ipv6 i'm setting up attempter so that way i'm not using windows temp i'm going to set up my specific temp directory i'm going to go ahead and set my time zones for america new york for both of these and then we're back into what was already there now let's go down to the end of this line we're going to leave the dash jar for the war file http port is 8080 but we want to change our web route our web root is going to be c tools jenkins war so we're going to replace webroot with a different reference location what we have here is a web root of c tools jenkins war and we have a plug-in route so our plugins are going to extract out into this directory of c tools jenkins plugins and then we have arguments and that's all good so we added a bunch of dash d's at the front we're adding plug-in root at the end and making a modification to webroot now there's one more change that we need to make to this file and we need to change the location of our pid file to be c tools jenkins again all of the changes that we've made to this file are primarily locations of exactly where i want my data to live or where i want extracted files or file caches to live so all of that is now within this jenkins.xml file so let's go ahead and save this file and go ahead we'll close it up and let's go and start our service so if we go ahead and look for services what we're going to see here i'll slide this over we're going to look for jenkins which is right here it's set up for administrator which we can sort of see there there's administrator let's go ahead and start this it says it's running but in reality if we refresh it we're going to see that it didn't start well how do we know what's going on well since we set up our locations for everything to be in c tools jenkins our log files are also here so let's take a look at the log files that were just created we have a jenkins wrapper file a jenkins out file and a jenkins err file if we first take a look at jkins out what we see here is this is running from the war file that's easy and good to go if we take a look at our wrapper we can see here that this is for the service starting up and all of that looks pretty good the pid didn't exist that's fine because it didn't exist on startup but then it recorded the pid that's okay but if we take a look at our error file or err file what we can see here is jenkins has failed to create a temporary file in c tools jenkins temp so one thing that we need to do before we start the service is we need to create a temp der inside of the c tools jenkins folder so tmp that's there now let's go back over to our services and start that back up so we can see it's running i'll just do a refresh here just to see it is running that's great it stayed running so now if we take a look we can see our jenkins pid file is here if we take a look again at our er file then what we're going to see is it's starting up and starting the plugins or starting the installation of the plugins so let's give this just a few moments to start up and then we will continue with the installation [Music] and now our server is up and running in fact we can see that it's fully up and running and we can go through and go ahead and do our setup so let's go ahead and do that so i'm going to click on my browser i'm going to go to localhost 8080 and if you're familiar with installing jenkins this screen is going to look very familiar to you as it starts up we are going to be asked for the password and the password here is going to be what we just copied out of our log file we'll click on continue and we will never save that install suggested plugins this will take just a few moments so we'll give it just a minute to download all of these plugins get it all extracted everything's going to look pretty good here now that the plugins are installed let's go ahead and create our user and click save and continue click save and finish and start using jenkins so now we can see here that we are ready to start using jenkins on our windows based controller one last thing i want to show you is we take a look at task manager and we go into more details what we're going to see here under our memory if we sort it by memory we can see that our open jdk platform binary which is the open jdk that's running our jenkins process is using right at about three gig which is what we specifically set inside of our jenkins xml file now that you've done the installation for jenkins on windows what should you be careful about backing up it really boils down to four items you're going to need your jenkins installer your jdk installer you'll also want to make sure you're backing up your jenkins home directory which in our case was c data jenkins underscore home and finally the one file you don't want to forget is the jenkins.xml file that lives in our case nc tools jenkins jenkins.xml if you have any questions or comments you can reach out to us on twitter at cloudbees if this video was helpful to you give us a thumbs up and if you haven't subscribed to cloudbees tv yet why not take a moment click on that subscribe button and then ring that bell and you'll be notified anytime there's new content available on cloudbees tv thanks for watching and we will see you in the next video you
Info
Channel: CloudBeesTV
Views: 118,355
Rating: undefined out of 5
Keywords: darin pope, jenkins, jenkins tutorial, install jenkins on windows, jenkins install in windows, jenkins windows, install jenkins, jenkins installation, jenkins installation on windows step by step, setup jenkins on windows, jenkins setup in windows, jenkins setup windows, install jenkins as windows service, jenkins windows installation guide, steps to install jenkins on windows, install jenkins on windows server, run jenkins on windows, install jenkins in windows step by step
Id: XuMrEDA8cAI
Channel Id: undefined
Length: 16min 1sec (961 seconds)
Published: Tue Dec 07 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.