Learn Jenkins

Self-hosted automation server for CI/CD pipelines written as code

15 lessons · 3 hours · 4 levels · covers Jenkins 2.580 LTS (Java 21/25)

Jenkins is an open-source automation server that builds, tests and deploys software through pipelines defined in a Jenkinsfile. You run it yourself, extend it with more than a thousand plugins and distribute work across agents. It remains one of the most widely deployed CI/CD systems, especially in enterprises with on-premise infrastructure and long-lived build setups.

Before you start

Jenkins builds on these; the tree links to the exact lessons you need.

How deep do you want to go?

1. EssentialsRead and write simple code, do the everyday basics5 lessons · 48 min in total
2. PracticalUse it productively at work, with the usual idioms9 lessons · 2 hours in total
3. AdvancedThe less common features, performance and trade-offs12 lessons · 2 hours in total
4. ExpertInternals and the edge cases experts know15 lessons · 3 hours in total

The Jenkins tree

JenkinsController, agents, jobs and pluginsController, agents,jobs and pluginsInstalling Jenkins with DockerInstalling Jenkinswith DockerYour first declarative pipelineYour first declarativepipelineJenkinsfile in source control and webhooksJenkinsfile in sourcecontrol and webho…post conditions, test reports and artifactspost conditions, testreports and artifactsEnvironment variables and credentialsEnvironmentvariables and crede…Agents, labels and Docker containersAgents, labels andDocker containersOptions, parameters, triggers and whenOptions, parameters,triggers and whenMultibranch pipelines and pull requestsMultibranch pipelinesand pull requestsRunning containers with docker runRunning containerswith docker runSharing work: push and pullSharing work: pushand pullImages and containersImages andcontainers
Essentials and Practical shown (9 of 15 lessons); the full list is below. Click a lesson to read it.

All 15 lessons, in order

Jenkins basics

  1. Controller, agents, jobs and plugins · Essentials · 6 min

    How Jenkins is organised: a controller that schedules jobs, agents that run them, and plugins that add almost every feature.

  2. Installing Jenkins with Docker · Essentials · 10 min

    Start a Jenkins LTS controller in Docker with a persistent volume, unlock it and install the suggested plugins.

Declarative pipelines

  1. Your first declarative pipeline · Essentials · 12 min

    Write a declarative pipeline with agent, stages and steps, and read its stage view and console output.

  2. Jenkinsfile in source control and webhooks · Essentials · 10 min

    Store the pipeline as a Jenkinsfile in the repository, use Pipeline from SCM, and trigger builds with webhooks instead of polling.

  3. post conditions, test reports and artifacts · Essentials · 10 min

    Run steps after stages or the whole build with post, publish JUnit results and archive build artifacts.

  4. Options, parameters, triggers and when · Practical · 12 min

    Add timeouts and build retention with options, ask for input with parameters, schedule builds, and run stages conditionally with when.

Agents, branches and credentials

  1. Environment variables and credentials · Practical · 12 min

    Define environment variables, store secrets in the Credentials store and bind them safely with credentials() and withCredentials.

  2. Agents, labels and Docker containers · Practical · 12 min

    Choose where stages run with agent labels, run steps inside Docker images, and use agent none for per-stage agents.

  3. Multibranch pipelines and pull requests · Practical · 10 min

    Let Jenkins discover every branch and pull request with a Jenkinsfile and build each one automatically.

Parallelism and reuse

  1. Parallel stages and matrix · Advanced · 12 min

    Run independent stages concurrently with parallel, and cover OS and version combinations with the matrix directive.

  2. Shared libraries · Advanced · 14 min

    Move common pipeline logic into a versioned Groovy library with vars/ steps and src/ classes, loaded with @Library.

  3. Scripted pipelines and the script block · Advanced · 12 min

    Know when declarative isn't enough, use script { } for logic, and read scripted node/stage pipelines.

Operating Jenkins

  1. CPS, durability and pipeline performance · Expert · 15 min

    Why pipeline Groovy is transformed into continuation-passing style, what survives a restart, and how to keep pipelines fast.

  2. Configuration as Code and plugin management · Expert · 14 min

    Define the whole Jenkins controller in YAML with JCasC, pin plugins in a file and build an immutable controller image.

  3. Securing and scaling a Jenkins controller · Expert · 14 min

    Run no builds on the controller, lock down authorization and credentials, and scale with ephemeral cloud agents.