Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save darinpope/6fa74d29e0e604ea648ac7d6ab2e5195 to your computer and use it in GitHub Desktop.
Save darinpope/6fa74d29e0e604ea648ac7d6ab2e5195 to your computer and use it in GitHub Desktop.
How To Install Jenkins on Amazon Linux 2023

Gist for https://youtu.be/xN3ks68uNKo

Install Temurin JDK

From CentOS/RHEL/Fedora Instructions:

  • Create RPM repository
cat <<EOF > /etc/yum.repos.d/adoptium.repo
[Adoptium]
name=Adoptium
baseurl=https://packages.adoptium.net/artifactory/rpm/amazonlinux/2/\$basearch
enabled=1
gpgcheck=1
gpgkey=https://packages.adoptium.net/artifactory/api/gpg/key/public
EOF
  • Install Temurin 17
    • dnf -y install temurin-17-jdk

Install Jenkins

From Jenkins Redhat Packages:

  • Create RPM repository
    • wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
  • Add repository key
    • rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
  • Install Jenkins
    • dnf -y 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
@RamDevOps12
Copy link

Uploading 1-error.PNG…
Uploading 2-error.PNG…

I follow same step
After installing Jenkins on Amazon Linux 2 EC2 and successful install, jenkins server start successful. But When I Login on browser with ec2-user-ip:8080 and show Unlock Jenkins then continue and go to Customize Jenkins box, Click on Install suggested plugins, then after I’m getting “An error occurred, Unable to connect to Jenkins” . So now what I do to solve this problem ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment