Install & your first pipeline

From zero to a green build.

Beginner12 min · lesson 3 of 15

The quickest way to a working Jenkins is the official container image — it pins a version, isolates the install, and is easy to throw away and recreate. On first boot Jenkins prints an initial admin password to the log and locks the setup wizard behind it, so nobody on the network can claim your fresh instance before you do.

terminal
$ docker run -d --name jenkins \
-p 8080:8080 -p 50000:50000 \ # 8080 = UI, 50000 = inbound agents
-v jenkins_home:/var/jenkins_home \ # persist config on a named volume
jenkins/jenkins:lts-jdk17
$ docker logs jenkins 2>&1 | grep -A2 "initial admin password"
... 2f3a...c9 # paste this into the setup wizard

The setup wizard

The wizard walks you through unlocking, installing the suggested plugins, and creating your first admin user — do create a real admin account rather than staying on the initial one, and never expose the instance publicly before that step. "Install suggested plugins" is fine to start, but keep the plugin lesson in mind: every plugin is code and attack surface.

Your first pipeline

Create a new item of type Pipeline, and instead of clicking through UI fields, give it a tiny script. Running it produces your first green build and shows the core anatomy — a pipeline, an agent to run on, and stages that appear as boxes in the UI. Everything else in this course builds on this shape.

Jenkinsfile (inline, first run)
pipeline {
agent any // run on any available agent
stages {
stage('Hello') {
steps { echo 'Hello from Jenkins' }
}
stage('Build') {
steps { sh 'echo building...' }
}
}
}
Persist JENKINS_HOME from the start
Everything Jenkins knows — jobs, config, build history, credentials — lives in JENKINS_HOME (/var/jenkins_home). Without a volume mounted there, recreating the container wipes the entire instance. Mount a named volume on the very first run so your Jenkins survives an upgrade or restart.