Managing Jenkins through dozens of UI screens can be tedious. With the Configuration as Code (CasC) plugin, you define your entire Jenkins setup—including core settings, security, plugins, tools, and credentials—as YAML. In this guide, you’ll learn how to:Documentation Index
Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
Use this file to discover all available pages before exploring further.
- Install and enable the CasC plugin
- Inspect your live Jenkins configuration
- Modify a setting declaratively and apply it
- Validate and reload configurations
1. Installing the Configuration as Code Plugin
- In Jenkins, go to Manage Jenkins → Manage Plugins → Available.
- Search for Configuration as Code, select it, and click Install (restart if prompted).

2. Exploring the Current Configuration
Navigate to Manage Jenkins → Configuration as Code. Here you can:- View Configuration: Download the live settings as YAML or JSON
- Replace Configuration: Point to a file on disk or a Git repo
- Reload: Reapply the last loaded settings

2.1 Downloaded Configuration Example
When you download your live settings, Jenkins outputs JSON or YAML. Below is a shortened JSON excerpt:2.2 YAML Section Reference
| Section | Description | Example Fields |
|---|---|---|
| jenkins | Core Jenkins settings | systemMessage, numExecutors, mode |
| security | Security and API token management | apiToken.tokenGenerationOnCreationEnabled |
| unclassified | Plugin-specific configurations | auditTrail, slackNotifier |
| tools | Tool installers (Git, Maven, Node.js) | maven.installations, nodejs.installations |
| credentials | Credentials domains and secrets | usernamePassword, string |
2.3 Credentials Example
You can explore more sections like global security, authorization strategies, and plugin settings by scrolling through the full YAML.
3. Modifying Configuration via CasC
Let’s update the Jenkins system message. First, back up and edit your YAML on the controller:remotingSecurity block:
Always back up your YAML and test in a non-production instance before applying major changes.
4. Applying and Reloading Configuration
On the CasC page you can also:- Reload Existing Configuration: Reapply last known-good settings
- Download Current Configuration: Fetch live YAML/JSON
- View Documentation: Open [JCasC docs][casc-doc]
- View JSON Schema: Inspect the schema for valid YAML

For more details, see the [official CasC documentation][casc-doc] and explore the [Jenkins schema reference][casc-schema].
Links and References
- Jenkins Configuration as Code (CasC) [casc-doc]
- Jenkins JSON Schema Reference [casc-schema]
- Jenkins Official Documentation