SadServers
  • Scenarios
  • Labs
    All Labs Linux & Bash Web Servers Databases Data Processing Docker Kubernetes CI/CD Infrastructure as Code Tooling / Applications
  • Dashboard
  • Solutions
    For Individuals For Businesses
  • Ranking
  • Newsletter
  • Documentation
    FAQ Support Pro Accounts Pro+ Accounts Business Accounts Gift API CLI/TUI Privacy Troubleshooting Interviews
  • Blog
  • Pricing
  • Gift
    Gift Purchase Gift Redeem
  • About
Log In - Sign Up
  1. Labs
  2. Jenkins
  3. Cheatsheet

Guide

Concepts and learning path

Troubleshooting

Failure modes and fixes

Cheatsheet

Commands to keep handy

Jenkins cheatsheet

Service and access

CheckDescription
systemctl status jenkinsService status (package install)
ss -tlnp | grep 8080Default HTTP port
echo $JENKINS_HOMEData directory
cat /var/lib/jenkins/secrets/initialAdminPasswordFirst-time admin password

CLI (jenkins-cli.jar)

wget -q $JENKINS_URL/jnlpJars/jenkins-cli.jar java -jar jenkins-cli.jar -s $JENKINS_URL -auth user:token help java -jar jenkins-cli.jar -s $JENKINS_URL list-jobs java -jar jenkins-cli.jar -s $JENKINS_URL build JOB_NAME -s -v

Pipeline Jenkinsfile snippets

pipeline { agent { label 'docker' } environment { REGISTRY = 'harbor.example.com/project' } stages { stage('Checkout') { steps { checkout scm } } stage('Build image') { steps { sh 'docker build -t $REGISTRY/app:$BUILD_NUMBER .' } } stage('Push') { steps { withCredentials([usernamePassword(credentialsId: 'harbor', usernameVariable: 'U', passwordVariable: 'P')]) { sh 'echo $P | docker login $REGISTRY -u $U --password-stdin' sh 'docker push $REGISTRY/app:$BUILD_NUMBER' } } } } }

Useful Groovy / steps

SnippetDescription
sh 'command'Run shell on agent
checkout scmClone configured SCM
withCredentials([...]) { }Inject secrets
when { branch 'main' }Conditional stage
parallel { ... }Concurrent stages
timeout(time: 30, unit: 'MINUTES')Stage timeout

Agent and executor checks

# UI: Manage Jenkins → Nodes # CLI: java -jar jenkins-cli.jar -s $JENKINS_URL list-nodes java -jar jenkins-cli.jar -s $JENKINS_URL get-node AGENT_NAME

Logs and disk

Path / commandDescription
tail -f /var/log/jenkins/jenkins.logServer log (Debian)
journalctl -u jenkins -fsystemd journal
du -sh $JENKINS_HOME/workspace/*Workspace disk use
Build → Console OutputPer-build log in UI

Safe restart

# UI: Manage Jenkins → Prepare for Shutdown / Restart java -jar jenkins-cli.jar -s $JENKINS_URL safe-restart # Or: systemctl restart jenkins (running builds may abort)

Pro tips

  • Console Output is the first log to read on any failed build
  • Pin plugins — document versions before upgrading Jenkins LTS
  • Use labels (agent { label 'linux' }) to target the right executors
  • Clean old builds and workspaces — disk fills silently under JENKINS_HOME
  • Store secrets in Credentials, not in the Jenkinsfile in Git

Practice scenarios

Hands-on Jenkins scenarios on live Linux VMs: jenkins

SadServersSadServers

Real-world Linux and DevOps scenarios for hands-on learning and technical assessment.

Uptime Robot ratio (30 days)
Product
  • Scenarios
  • For Individuals
  • For Businesses
  • Pricing
Resources
  • FAQ
  • Blog
  • Newsletter
Company
  • About Us
  • Support
  • Privacy Policy
  • Terms of Service
  • Contact
Connect With Us
info@sadservers.com

Made in Canada 🇨🇦
Updated: 2026-06-13 16:06 UTC – 2d2950a