Step-by-Step Guide to Install and Deploy Jenkins on Linux, Windows, and macOS
This comprehensive tutorial walks you through installing Jenkins on Linux, Windows, and macOS, covering system requirements, installation methods, initial configuration, security hardening, common operations, plugin management, backup, troubleshooting, and future expansion options.
System Requirements
Java : Jenkins requires JDK 11 or 17. Verify with java -version. Install on Debian/Ubuntu with sudo apt update && sudo apt install openjdk-17-jdk.
Installation
Linux (Ubuntu/Debian/CentOS)
Method 1 – Official repository (recommended)
curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | sudo tee /usr/share/keyrings/jenkins-keyring.asc > /dev/null
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
sudo apt update
sudo apt install jenkinsMethod 2 – WAR package (universal)
wget https://get.jenkins.io/war-stable/latest/jenkins.war
java -jar jenkins.war --httpPort=8080Windows
Download the .msi installer from the official Jenkins site.
Run the installer; it registers the Jenkins service and installs Java automatically.
macOS
brew install jenkins
brew services start jenkinsStarting Jenkins
Linux (systemd)
sudo systemctl start jenkins
sudo systemctl enable jenkins # enable at boot
sudo systemctl status jenkins # check statusRun WAR manually
java -jar jenkins.war --httpPort=8080Initial Configuration
Open a browser and navigate to http://<em>host-or-ip</em>:8080.
Retrieve the initial admin password:
sudo cat /var/lib/jenkins/secrets/initialAdminPassword(Windows/macOS passwords appear in the installation log.)
Install the suggested plugins and create an administrator account.
Security Hardening (Recommended)
Configure firewall (example for Ubuntu):
sudo ufw allow 8080
sudo ufw enableEnable HTTPS via an Nginx or Apache reverse proxy with an SSL certificate.
Restrict access in Manage Jenkins → Configure Global Security using matrix‑based security.
Common Operations
Restart Jenkins sudo systemctl restart jenkins View logs
sudo journalctl -u jenkins -f
# or
tail -f /var/log/jenkins/jenkins.logUninstall Jenkins
sudo apt remove --purge jenkins # Ubuntu/Debian
sudo rpm -e jenkins # CentOSPlugin Management
Navigate to Manage Jenkins → Plugins → Available plugins .
Install common plugins such as Git , Pipeline , Docker , and Kubernetes .
Backup and Restore
Backup the Jenkins data directory:
tar -czvf jenkins_backup.tar.gz /var/lib/jenkinsRestore by extracting the archive back to the original path.
Frequently Asked Questions
Port conflict : edit /etc/default/jenkins and change HTTP_PORT.
Plugin installation failures : switch to a local mirror in Manage Jenkins → Plugin Manager → Advanced .
Insufficient memory : increase JVM heap size:
echo "JAVA_OPTS=\"-Xmx1024m\"" | sudo tee -a /etc/default/jenkins
sudo systemctl restart jenkinsFuture Expansion Directions
Configure CI/CD pipelines for Maven, Node.js, or Go projects.
Integrate Docker/Kubernetes for distributed builds.
Set up GitHub/GitLab webhooks to trigger builds automatically.
Deploy multiple Jenkins agents to improve build throughput.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Ray's Galactic Tech
Practice together, never alone. We cover programming languages, development tools, learning methods, and pitfall notes. We simplify complex topics, guiding you from beginner to advanced. Weekly practical content—let's grow together!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
