Enough theory. Let us get Jenkins running on your machine. The easiest way is Docker — one command and you have a full Jenkins server. No Java installation, no path variables, no headaches.
If you have Docker installed, this is a 2-minute setup. If you do not have Docker, install Docker Desktop first.
# Pull the official Jenkins LTS image and run it
docker run -d \
--name jenkins \
-p 8080:8080 \
-p 50000:50000 \
-v jenkins_home:/var/jenkins_home \
jenkins/jenkins:lts
# Wait 30 seconds for Jenkins to start, then get the initial password
docker exec jenkins cat /var/jenkins_home/secrets/initialAdminPassword# Prerequisites: Java 17+ must be installed
java -version
# Download Jenkins WAR from https://www.jenkins.io/download/
# Run it directly
java -jar jenkins.war --httpPort=8080
# Jenkins prints the initial admin password in the terminal
# Look for a line like:
# Jenkins initial setup is required. An admin user has been created...
# Password: 4a8b2c3d4e5f6g7hThe suggested plugins cover basics. But for Selenium test automation, you need a few more. Go to Manage Jenkins > Plugins > Available plugins and install:
Go to Manage Jenkins > Tools. This is where you tell Jenkins where Java and Maven live.
The tool names you set here (like "Maven-3.9" and "JDK-17") must match exactly what you write in your Jenkinsfile. If your Jenkinsfile says tools { maven "Maven-3.9" } but you named it "maven3" in global tools, the pipeline will fail with "Tool not found."
Bookmark http://localhost:8080. You will use it a lot. And remember — if you used Docker, run "docker start jenkins" after a reboot to bring Jenkins back up.
Key Point: One Docker command gives you a full Jenkins server. Install suggested plugins, add Maven/TestNG/Allure plugins, configure JDK and Maven in global tools.