Jenkins Installation, Configuration, and Administration
What this domain covers
This domain tests whether you can stand up a Jenkins controller from scratch, choose the right distribution, wire it to a persistent home directory, and administer it day to day without corrupting state. Expect questions on the WAR file versus native packages, JENKINS_HOME layout, JVM and system properties, the setup wizard, and Configuration as Code.
Core rules
- Two release lines. Weekly releases ship every week with new features; LTS releases are cut roughly every 12 weeks from a weekly baseline and receive backported fixes. Controlled production controllers should run LTS.
- JENKINS_HOME holds everything mutable:
config.xml,jobs/,users/,plugins/,secrets/,workspace/,logs/. Backing up Jenkins means backing up this directory with the controller quiesced. - Startup.
java -jar jenkins.war --httpPort=8080runs on the embedded Winstone container. Useful flags:--prefix=/jenkinsfor a reverse-proxy sub-path,--httpListenAddress=127.0.0.1to bind loopback,--argumentsRealm.passwd.admin=...for scripted bootstrap. Container images readJAVA_OPTSandJENKINS_OPTS. - JVM sizing. Set heap with
-Xmx(e.g.-Xmx4g). Controller heap is dominated by in-memory job, build, and agent metadata, not build output, so give it its own dedicated disk rather than relying on memory. - Unlock. The first start writes a one-time password to
$JENKINS_HOME/secrets/initialAdminPassword; the wizard then offers suggested plugins and the first admin account. - Configuration as Code. The
configuration-as-codeplugin loadsjenkins.yamlfromCASC_JENKINS_CONFIG(path, directory, or URL) and exports the live config via/configuration-as-code/export. Secrets can be sourced from environment variables so the YAML stays free of cleartext. - CLI.
java -jar jenkins-cli.jar -s https://ci.example/ -auth user:tokenexposesinstall-plugin,safe-restart,build,list-plugins.
Worked example
You must move a controller from http://host:8080/ to https://ci.example.com/jenkins/ behind nginx. Start Jenkins with --prefix=/jenkins bound to 127.0.0.1, terminate TLS at nginx, and proxy with proxy_pass http://127.0.0.1:8080/jenkins/;. Reasoning: Jenkins generates absolute URLs from the prefix, so the proxy location and --prefix must agree exactly; changing the prefix later leaves stale URLs in job configs and webhook payloads.
Traps
Editing config.xml while Jenkins is running - the in-memory model overwrites it on save. Confusing plugins you uninstalled with plugins that are merely disabled. Assuming JENKINS_HOME is only jobs/ and missing secrets/ in a backup. Running weekly releases on a controlled production controller.