Jenkins is an open-source automation server widely used for continuous integration and continuous delivery (CI/CD). It supports building, testing, and deploying code using pipelines and integrates with various tools.
This guide covers step-by-step Jenkins installation instructions on:
- Ubuntu (Linux)
- Windows
- macOS
Jenkins Installation on Ubuntu (Debian-based Linux)
Prerequisites
- Ubuntu 18.04+ (or Debian-based distro)
- Java 11 or newer
- Root or sudo access
Step-by-Step Installation
1. Update System
sudo apt update
sudo apt upgrade -y
2. Install Java (OpenJDK 17 recommended)
sudo apt install openjdk-17-jdk -y
java -version
3. Add Jenkins Repository Key
curl -fsSL https://pkg.jenkins.io/debian/jenkins.io-2023.key | sudo tee \
/usr/share/keyrings/jenkins-keyring.asc > /dev/null
4. Add Jenkins Source List
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
https://pkg.jenkins.io/debian binary/ | sudo tee \
/etc/apt/sources.list.d/jenkins.list > /dev/null
5. Install Jenkins
sudo apt update
sudo apt install jenkins -y
6. Start and Enable Jenkins
sudo systemctl start jenkins
sudo systemctl enable jenkins
7. Adjust Firewall (if using UFW)
sudo ufw allow 8080
sudo ufw reload
8. Access Jenkins Web Interface
Open in browser:
http://localhost:8080
9. Get the Administrator Password
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
Copy the password into the Jenkins setup screen and continue setup.
Jenkins Installation on Windows
Prerequisites
- Windows 10 or 11
- Java JDK 11 or newer installed and added to
PATH
Step-by-Step Installation
1. Download Jenkins Windows Installer
Go to:
👉 https://www.jenkins.io/download/
Choose Windows → download the .msi
installer.
2. Run Installer
- Double-click
.msi
file - Follow the installation wizard
- Jenkins will install as a Windows service
- Default port: 8080
3. Find Initial Admin Password
Navigate to:
C:\Program Files\Jenkins\secrets\initialAdminPassword
Copy the password and paste it into the web setup wizard.
4. Access Jenkins
Open browser:
http://localhost:8080
Complete the setup (install suggested plugins and create admin user).
Jenkins Installation on macOS
Prerequisites
- macOS 11+ (Big Sur or newer)
- Homebrew installed
- Java 11 or newer
Step-by-Step Installation
1. Install Java (if not already installed)
brew install openjdk@17
Add Java to your shell:
echo 'export PATH="/opt/homebrew/opt/openjdk@17/bin:$PATH"' >> ~/.zprofile
source ~/.zprofile
2. Install Jenkins
brew install jenkins-lts
3. Start Jenkins
brew services start jenkins-lts
Jenkins runs by default on port 8080
.
4. Access Jenkins Web Interface
Open:
http://localhost:8080
5. Get the Admin Password
cat /Users/$(whoami)/.jenkins/secrets/initialAdminPassword
Paste this password into the Jenkins setup wizard.
Post-Installation Tips (All Platforms)
- Install Suggested Plugins (default in setup wizard)
- Create Admin User
-
Configure Tools:
- JDK
- Maven
- Git
- Docker
-
Install Additional Plugins:
- GitHub Integration
- Pipeline
- Blue Ocean UI
- Docker, Kubernetes plugins (if needed)
- Secure Jenkins with HTTPS or reverse proxy (optional)
- Create a sample pipeline or freestyle job
Uninstallation
Ubuntu
sudo apt remove --purge jenkins
sudo rm -rf /var/lib/jenkins
Windows
- Use “Add or Remove Programs”
- Delete
C:\Program Files\Jenkins
folder
macOS
brew services stop jenkins-lts
brew uninstall jenkins-lts
rm -rf ~/.jenkins
Troubleshooting
Issue | Fix |
---|---|
Jenkins not starting | Check logs: sudo journalctl -u jenkins (Ubuntu) |
Port 8080 in use | Change port in /etc/default/jenkins or jenkins.xml |
Java version errors | Ensure JAVA_HOME is correctly set |
Firewall blocks Jenkins | Allow port 8080 in OS firewall settings |
Conclusion
Setting up Jenkins on Ubuntu, Windows, or macOS is straightforward using either package managers or official installers. Once installed, Jenkins provides a powerful platform for automating builds, tests, and deployments in modern DevOps environments.
Â