Steps to Install Jenkins on M1/M2 Mac


Below are the steps to install Jenkins on your ARM-based M1/M2 Mac using Homebrew package manager.

  1. Open Terminal application.
  2. Make sure brew is installed on your Mac.
    % brew --version
    Homebrew 4.1.14

    If you get an error "zsh: command not found: brew" then make sure to install brew first.

  3. Now we are good to install Jenkins.
    % brew install jenkins-lts

    Logs:

    % brew install jenkins-lts
    ==> Fetching dependencies for jenkins-lts: openjdk@17
    ==> Downloading https://ghcr.io/v2/homebrew/core/openjdk/17/manifests/17.0.8.1
    ############## 100.0%
    ==> Fetching jenkins-lts
    ==> Downloading https://ghcr.io/v2/homebrew/core/jenkins-lts/blobs/sha256:xx
    ############## 100.0%
    ==> Installing dependencies for jenkins-lts: openjdk@17
    ==> Installing jenkins-lts dependency: openjdk@17
    ==> Downloading https://ghcr.io/v2/homebrew/core/openjdk/17/manifests/17.0.8.1
    Already downloaded: /Users/dev/Library/Caches/Homebrew/downloads/xx--openjdk@17-17.0.8.1.bottle_manifest.json
    ==> Pouring openjdk@17--17.0.8.1.arm64_sonoma.bottle.tar.gz
    🍺  /opt/homebrew/Cellar/openjdk@17/17.0.8.1: 635 files, 305MB
    ==> Installing jenkins-lts
    ==> Pouring jenkins-lts--2.414.2.arm64_sonoma.bottle.tar.gz
    ==> Caveats
    Note: When using launchctl the port will be 8080.
    
    To start jenkins-lts now and restart at login:
      brew services start jenkins-lts
    Or, if you don't want/need a background service you can just run:
      /opt/homebrew/opt/openjdk@17/bin/java -Dmail.smtp.starttls.enable\=true 
    -jar /opt/homebrew/opt/jenkins-lts/libexec/jenkins.war --httpListenAddress\=127.0.0.1 --httpPort\=8080
    ==> Summary
    🍺  /opt/homebrew/Cellar/jenkins-lts/2.414.2: 8 files, 88.8MB
    ==> Running `brew cleanup jenkins-lts`...
    Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
    Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
    ==> Caveats
    ==> jenkins-lts
    Note: When using launchctl the port will be 8080.
    
    To start jenkins-lts now and restart at login:
      brew services start jenkins-lts
    Or, if you don't want/need a background service you can just run:
      /opt/homebrew/opt/openjdk@17/bin/java -Dmail.smtp.starttls.enable\=true 
    -jar /opt/homebrew/opt/jenkins-lts/libexec/jenkins.war --httpListenAddress\=127.0.0.1 --httpPort\=8080
  4. Now to start Jenkins we will run the below brew command.
    % brew services start jenkins-lts

    Logs:

    ==> Tapping homebrew/services
    Cloning into '/opt/homebrew/Library/Taps/homebrew/homebrew-services'...
    remote: Enumerating objects: 2547, done.
    remote: Counting objects: 100% (300/300), done.
    remote: Compressing objects: 100% (154/154), done.
    remote: Total 2547 (delta 173), reused 201 (delta 142), pack-reused 2247
    Receiving objects: 100% (2547/2547), 707.22 KiB | 954.00 KiB/s, done.
    Resolving deltas: 100% (1173/1173), done.
    Tapped 1 command (45 files, 881.0KB).
    ==> Successfully started `jenkins-lts` (label: homebrew.mxcl.jenkins-lts)
Installing and Running Jenkins on M1 or M2 Mac
-

Facing issues? Have Questions? Post them here! I am happy to answer!


Author Info:

Rakesh (He/Him) is a seasoned developer with over 10 years of experience in web and app development, and a deep knowledge of operating systems. Author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail: rakesh@code2care.org

Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap