1. Check Homebrew
Open Terminal and run:
brew --version
If you see a version number, continue.
If brew: command not found, install Homebrew first:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
2. Install Java
brew install openjdk@21
Then:
java -version
You should see something similar to:
openjdk version "21..."
If java isn't found, run:
sudo ln -sfn $(brew --prefix)/opt/openjdk@21/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-21.jdk
Then check again:
java -version
3. Install Jenkins
Install the current LTS version:
brew install jenkins-lts
4. Start Jenkins
brew services start jenkins-lts
Check it:
brew services list
You want to see something like:
jenkins-lts started
5. Open Jenkins
In your browser, open:
You should get the Unlock Jenkins screen.
6. Get the Jenkins password
Run:
cat ~/.jenkins/secrets/initialAdminPassword
Copy the password and paste it into the browser.
If that file doesn't exist, use:
find ~/.jenkins -name initialAdminPassword 2>/dev/null
7. Finish setup
Choose Install suggested plugins, wait for installation, then create your Jenkins admin user.
After that you'll have:
Mac
│
├── Java 21
│
└── Jenkins
│
└── localhost:8080
Useful commands:
# Stop Jenkins
brew services stop jenkins-lts
# Start Jenkins
brew services start jenkins-lts
# Restart Jenkins
brew services restart jenkins-lts
If you paste the output of Step 1 (brew --version), I can take you through the installation one command at a time.
Top comments (0)