If you want a no fuss way to spin up Jenkins for local testing and light CI work then the single WAR file is your best friend and your guilty pleasure. This guide walks through downloading the WAR running it with java and getting through the first time setup without losing your mind or your plugins.
Grab the jenkins.war from the official Jenkins site or a trusted mirror and drop it into a folder you do not plan to overthink. That one file contains an embedded servlet container so you do not need Tomcat to start playing with continuous integration on your laptop.
Open a terminal and run the embedded server with the classic command
java -jar jenkins.war
Want a different HTTP port because 8080 is that one port your other project hogs Use this
java -jar jenkins.war --httpPort=9090
Then open a browser and go to localhost on the chosen port. The console will print startup logs and an initial admin unlock key. If your terminal scrolled away you can find the same value in the Jenkins home folder under secrets/initialAdminPassword
inside your Jenkins home directory which is often ~/.jenkins
by default.
When the UI asks for the unlock key paste the one from the console or from the file. Then pick the install recommended plugins path unless you enjoy spending time resolving plugin dependency puzzles. Create the first admin user when prompted and be warned that plugin downloads can take a few minutes depending on your internet and mood.
Set an explicit JENKINS_HOME environment variable to keep data in a predictable place. For example export JENKINS_HOME=/opt/jenkins or set it in a service file when you move to a system level setup. Predictability will save you a future apology to yourself.
[Unit]
Description=Jenkins
After=network.target
[Service]
User=jenkins
ExecStart=/usr/bin/java -jar /opt/jenkins/jenkins.war
Restart=on-failure
[Install]
WantedBy=multi-user.target
The single command method is perfect for demos development and quick experiments. For anything that needs to stay alive overnight or serve a team use a proper deployment method like a service a servlet container or container orchestration. That way Jenkins does not go down when your laptop goes to sleep or when someone bumps into your terminal.
Enjoy your local CI playground and remember to back up your jobs if you start caring about them. This tutorial covered downloading the WAR running it with java accessing the UI on the correct port unlocking the initial setup and options for running Jenkins in a more robust way for real devops workflows.
I know how you can get Azure Certified, Google Cloud Certified and AWS Certified. It's a cool certification exam simulator site called certificationexams.pro. Check it out, and tell them Cameron sent ya!
This is a dedicated watch page for a single video.