JCasC is ideal for automating Jenkins bootstrap and day‑to‑day configuration. Use YAML files to manage core settings, tool installations, credentials (via encrypted values), and many plugin configurations.
Install and open Configuration as Code
- Install the Configuration as Code plugin from Manage Jenkins → Manage Plugins. Note: installing the plugin requires a Jenkins restart.
- After restart, log back in and navigate to Manage Jenkins → Configuration as Code.
- View the effective configuration (a generated YAML file representing the current running instance).
- Load or replace configuration from a local file, URL, or Git repository.
- Download or reload the current configuration.
- Access JCasC documentation and the JSON schema.

Inspect the effective configuration (YAML)
Click “View Configuration” (or equivalent) to generate the effective configuration YAML. It is a comprehensive document that maps Jenkins core and plugin settings to a declarative structure. Below are trimmed, representative excerpts to illustrate common sections. Example — global and UI-related settings:Never store plain-text secrets or private keys in a public repository. If you keep configuration files in Git, use a secrets manager or Jenkins credentials provider (and avoid committing the raw secret values).
Persist a JCasC YAML file on the controller and apply it
To have Jenkins load a persistent JCasC file from disk:- Choose a location accessible by the Jenkins process. Example:
- Create the YAML file and paste your JCasC content:
- In Manage Jenkins → Configuration as Code, set the configuration path to the file you created (for example):
- Click “Apply new configuration”. JCasC will validate the YAML and report any validation errors. On success, the configuration is applied and the UI shows a timestamp and source path indicating where the config was loaded from.
JSON schema and documentation
- Official plugin page: https://plugins.jenkins.io/configuration-as-code/
- Source and examples: https://github.com/jenkinsci/configuration-as-code-plugin
Conclusion
Jenkins Configuration as Code simplifies managing Jenkins at scale. With JCasC you can:- Capture your running instance as YAML,
- Persist reusable, versionable configuration files,
- Apply configuration deterministically across controllers and environments.