Skip to content

Instantly share code, notes, and snippets.

@darinpope
Last active October 12, 2023 11:22
Show Gist options
  • Save darinpope/b82d31ec9d70d20163c2614bfbed1a36 to your computer and use it in GitHub Desktop.
Save darinpope/b82d31ec9d70d20163c2614bfbed1a36 to your computer and use it in GitHub Desktop.
How to Install Jenkins on Debian 11

Gist for https://youtu.be/RxPSlUh0NpQ

Install Temurin JDK

From Deb installation on Debian or Ubuntu:

  • Ensure the necessary packages are present:

    • apt install -y wget apt-transport-https
  • Download the Eclipse Adoptium GPG key:

    • mkdir -p /etc/apt/keyrings
    • wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public | tee /etc/apt/keyrings/adoptium.asc
  • Configure the Eclipse Adoptium apt repository:

    • echo "deb [signed-by=/etc/apt/keyrings/adoptium.asc] https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list
  • Install Temurin 17

    • apt update
    • apt install temurin-17-jdk

Install Jenkins

From Jenkins Debian Packages:

  • Add repository key

    • curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo tee /usr/share/keyrings/jenkins-keyring.asc > /dev/null
  • Create apt repository

    • echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] https://pkg.jenkins.io/debian-stable binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list > /dev/null
  • Install Jenkins

    • apt update
    • apt install jenkins

Configure Jenkins

  • systemctl --full status jenkins
  • systemctl edit jenkins
[Service]
Environment="JAVA_OPTS=-Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -Djava.io.tmpdir=/var/cache/jenkins/tmp/ -Dorg.apache.commons.jelly.tags.fmt.timeZone=America/New_York -Duser.timezone=America/New_York"
Environment="JENKINS_OPTS=--pluginroot=/var/cache/jenkins/plugins"
  • mkdir -p /var/cache/jenkins/tmp
  • chown -R jenkins:jenkins /var/cache/jenkins/tmp
  • systemctl show jenkins
  • systemd-analyze verify jenkins.service
  • systemctl start jenkins
  • systemctl --full status jenkins
  • journalctl -u jenkins
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment