JENKINS_HOME, Filesystem Layout, Controller Configuration, System Settings, Tools, and Global Properties: Concepts, Architecture, and Mental Model
Understand JENKINS_HOME as durable Jenkins controller state: configuration, jobs, build records, plugins, secrets, tools, caches, workspaces, and recovery boundaries.
Learning objectives
-
Explain why
JENKINS_HOMEis the durable state boundary of a Jenkins controller rather than merely “a folder Jenkins happens to use.” - Classify controller files as configuration, job/build records, plugins, secrets/keys, tools/cache, workspace/runtime data, or recovery evidence.
- Distinguish durable controller state from agent workspaces and external systems such as SCM, artifact repositories, registries, and deployment targets.
- Inspect home path, ownership, file names, sizes, and timestamps without dumping credentials or sensitive configuration into logs.
- Connect configuration ownership and backup scope to restart, restore, rollback, and disaster-recovery behavior.
1. The problem: Jenkins is easy to start and easy to misunderstand
A Jenkins controller is a long-running stateful service. The executable can be replaced in minutes, but the controller becomes valuable because it accumulates configuration, item definitions, build records, plugin state, users, cryptographic keys, and operational history. If that durable state is mixed with throwaway workspaces or if administrators edit internal files casually, routine maintenance becomes a recovery incident.
Chapter 02 separated the replaceable container image from the
persistent /var/jenkins_home volume. This chapter goes
one layer deeper: what is inside that persistent boundary, which
parts are authoritative, which parts are reconstructable, and which
parts are dangerous to expose or edit directly.
JENKINS_HOME as
application data owned by the controller. Inspect first, change it
through supported configuration surfaces when possible, preserve
recovery material, and validate restores before you call a backup
strategy complete.
2. Mental model: controller process → home → durable state → recovery boundary
The controller process reads configuration from
JENKINS_HOME, loads core and plugins, reconstructs
items and historical records, exposes configured global behavior,
then coordinates builds. A restart replaces process memory; it
should not erase durable state. A container replacement replaces the
container filesystem; it should not erase the mounted home volume.
flowchart TD A[Jenkins core + Java process] --> B[JENKINS_HOME] B --> C[Global configuration XML and plugin state] B --> D[Jobs, folders, build records, artifacts] B --> E[Plugins and plugin data] B --> F[Secrets and cryptographic keys] B --> G[Tool/cache/runtime files] C --> H[Controller behavior after restart] D --> H E --> H F --> H H --> I[Queue and agent execution] I --> J[Agent workspace - execution state] I --> K[External SCM / registry / cloud / deployment state] B --> L[Backup + restore boundary] F --> M[Protected recovery material stored separately]
The diagram deliberately separates an agent workspace and an external deployment target from controller home. A successful restore of controller files does not reconstruct a deleted cloud resource, and a clean agent workspace should be reproducible from source and declared dependencies rather than from a controller backup.
3. A practical JENKINS_HOME anatomy
Exact files vary with Jenkins core, plugins, installation mode, and history. Never assume every controller has the same tree. The safe approach is to inspect the actual instance and understand categories rather than memorize one sample listing.
| Area | Typical examples | Operational meaning | Handling rule |
|---|---|---|---|
| Root configuration |
config.xml, other root *.xml
|
Core/global/plugin configuration serialized by Jenkins. | Prefer supported UI/JCasC/plugin APIs; do not live-edit casually. |
| Items and history |
jobs/, nested job/folder directories, build
records
|
Job configuration, run history, archived outputs depending on job/plugin. | Retention policy determines size and recovery value. |
| Plugins |
plugins/*.jpi/*.hpi, expanded
plugin directories
|
Executable controller extensions and version-specific data. | Track exact versions; test upgrades and rollback. |
| Secrets/keys |
secrets/, instance identity and encryption
material
|
Keys required to decrypt protected controller data and identify the controller. | Never print; protect permissions; back up separately from ordinary controller backup evidence. |
| Users/nodes | user and node-related directories/configuration | Controller-local identity/profile and static node configuration where applicable. | Treat as durable configuration; plugin/realm details vary. |
| Tools/cache |
tools/, cache/,
downloaded/extracted data
|
Performance/convenience data that may be reconstructable. | Decide by RTO and reproducibility; not all caches need every backup. |
| Workspace-like data | controller workspace directories when the built-in node is used | Execution filesystem, not durable release identity. | Current guidance is to run routine builds on agents; do not rely on controller workspace persistence. |
4. Discover home path and ownership before touching files
Inside the official container used in this course,
JENKINS_HOME is /var/jenkins_home. Native
packages use different defaults. Jenkins also shows the active home
directory under Manage Jenkins → System. Inspect the running
instance instead of assuming a path copied from a tutorial.
docker exec jenkins-ch02-controller sh -lc '
printf "JENKINS_HOME=%s\n" "$JENKINS_HOME"
id
stat -c "owner=%U:%G mode=%a path=%n" "$JENKINS_HOME"
find "$JENKINS_HOME" -maxdepth 1 -mindepth 1 -printf "%f\n" | sort | sed -n "1,80p"
'
If your Chapter 02 container no longer exists, use the standalone setup in Lesson 2. Notice what the command does not do: it does not recursively print XML, credentials, tokens, secret files, or build logs. File names, ownership, size, and timestamps are normally enough for a first inventory.
5. Configuration has an owner and a persistence path
Manage Jenkins → System changes global controller settings and plugin-provided system settings. Manage Jenkins → Tools configures tool installations/providers. Plugins can add their own persistent files or sections. Later in the course, Jenkins Configuration as Code (JCasC) will provide a version-controlled source for supported configuration. These are different configuration ownership models.
Saved by Jenkins into controller configuration. Good for learning and small local controllers; harder to review at scale.
Later chapters treat YAML in SCM as the desired source for supported controller/plugin configuration.
Some behavior is controlled by JVM/system properties at process start. Those belong to service/container launch configuration, not arbitrary XML edits.
SCM, registries, clouds, IdPs, secret stores, and deployment targets remain authoritative outside Jenkins.
The critical production question is not merely “where is the value stored?” but “what is the accountable source of truth, who changes it, and how would we reconstruct it after loss?”
6. Durable state, reconstructable state, and ephemeral state
| State | Examples | Recovery expectation |
|---|---|---|
| Durable controller state | Job configuration, system settings, plugin baseline, required build records, encrypted credential records | Restore or recreate from an explicit configuration source. |
| Protected recovery material |
Secret-key material under JENKINS_HOME/secrets
|
Recover from a separately protected copy; never publish in ordinary backup artifacts. |
| Reconstructable controller data | Some caches, expanded plugin files, downloaded tools | Can often be recreated, but excluding them increases restore time and may complicate exact-version recovery. |
| Agent execution state | Checkouts, temporary build files, compiler caches on an agent | Normally recreate from source/tooling; do not treat as release evidence. |
| External durable state | Git commit, artifact repository package, registry digest, cloud deployment | Verify in the owning system; Jenkins backup does not recreate it. |
7. Backup scope is a recovery-design decision
Jenkins documentation recommends backups and, importantly, restore validation. A full home snapshot is simplest conceptually, while selective backups can reduce size and time. Consistent filesystem snapshots are preferable when available because they avoid copying different files at different points in time.
Secret-key material deserves a separate trust boundary. The credentials/security guidance warns that anyone who obtains both encrypted Jenkins data and its secret keys may recover the protected information. This course therefore keeps secret-key archives separate from ordinary controller backup archives even though both are required for a full restore.
8. Read-only inspection patterns
# Size by top-level directory without reading secret contents
docker exec jenkins-ch02-controller sh -lc '
du -sh "$JENKINS_HOME"/* 2>/dev/null | sort -h | tail -20
'
# Inspect only safe metadata for selected files
docker exec jenkins-ch02-controller sh -lc '
stat -c "%y %s %n" "$JENKINS_HOME/config.xml"
find "$JENKINS_HOME/jobs" -maxdepth 3 -name config.xml -printf "%TY-%Tm-%Td %TH:%TM %s %p\n" 2>/dev/null | head -20
'
These commands answer “what exists, how large is it, and when did it change?” without dumping configuration into a terminal transcript. When troubleshooting, preserve this metadata before restarts or repair.
9. Common misconceptions
- “JENKINS_HOME is just job XML.” It also contains controller/global/plugin data, histories, cryptographic material, and other operational state.
- “A mounted volume is a backup.” Persistence protects against container replacement; it does not provide independent recovery from corruption or operator mistakes.
- “Workspace files are Jenkins state.” Workspaces are execution state and should usually be reproducible from source and declared dependencies.
- “If XML is human-readable, editing it live is supported.” Jenkins owns serialization; direct edits can be overwritten, ignored, or made inconsistent with in-memory state.
- “JCasC means backups are unnecessary.” Configuration as code does not automatically preserve all job histories, plugin data, encrypted records, or recovery keys.
10. Summary
-
JENKINS_HOMEis the controller’s durable operational state boundary. - Configuration, build history, plugins, secret keys, caches/tools, workspaces, and external systems have different recovery requirements.
- Supported UI/configuration interfaces should own changes; raw filesystem edits are an exception handled with the controller stopped and a recovery plan.
- Backups are not credible until a restore is validated on an isolated controller.
- Secret-key recovery material is necessary but must be protected separately from ordinary backup evidence.
Knowledge check
Why is a Docker volume at
/var/jenkins_home persistence but not a complete
backup strategy?
The volume survives container replacement but can still be corrupted, deleted, or changed incorrectly. Recovery needs an independent copy and a tested restore procedure.
Which state should normally be recreated rather than treated as durable release evidence: an agent workspace or an archived artifact tied to a build?
The agent workspace is execution state. A deliberately archived/published artifact with build/source identity is the durable evidence candidate.
Why should you avoid recursively printing
JENKINS_HOME while collecting evidence?
Home can contain credentials, tokens, secret keys, user data, build logs, and plugin configuration. Metadata-only inspection reduces disclosure risk.
A configuration change survives a process restart. What does that prove?
It proves the value was persisted in state Jenkins reloaded. It does not prove that a separate backup exists or that a disaster restore works.
What is the strongest way to validate a controller backup?
Restore it into an isolated controller/path/port with the required version and separately protected recovery material, then verify expected configuration and records.
Official references and version notes
- Configuring the System — current Jenkins home-directory and global system-configuration guidance.
- Managing Jenkins — current administrative surfaces for System, Tools, Plugins, status, and troubleshooting.
- System Information — controller system properties, environment variables, plugins, memory information, and diagnostics.
- Managing Tools — built-in tool-provider concepts and global tool configuration.
- Backing-up/Restoring Jenkins — backup scope, controller-key separation, and restore validation.
- Credentials security — why Jenkins secret-key material needs protection and separation from ordinary backups.
-
Storing Secrets
— technical description of Jenkins encryption keys under
$JENKINS_HOME/secrets. - Controller Isolation — current guidance for keeping routine builds off the built-in controller node.
- Jenkins LTS changelog and Java Support Policy — version/runtime assumptions for this chapter.
Version-sensitive statements were rechecked on
2026-09-14. The disposable baseline continues
Chapter 02 with Jenkins 2.568.3 LTS on
Java 21 using the official
jenkins/jenkins:2.568.3-jdk21 image. Jenkins and
plugins evolve; regenerate the storage map from the actual
controller, keep plugin-specific files opaque unless the plugin
documents them, and re-check backup/security guidance before
applying the patterns to a production controller.
Keep the academy open
Support free, practical DevOps education.
Every lesson is designed to remain readable in a browser, downloadable from GitHub, and usable without a paid learning platform. Contributions help expand and maintain the curriculum.
0x716c4Ab160C4B66F31a28AE2448BfF68fc3a2ef0Send only Ethereum/ERC-20 compatible assets to this
address.