Operations 6 min read

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.

Ray's Galactic Tech
Ray's Galactic Tech
Ray's Galactic Tech
Step-by-Step Guide to Install and Deploy Jenkins on Linux, Windows, and macOS

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 jenkins

Method 2 – WAR package (universal)

wget https://get.jenkins.io/war-stable/latest/jenkins.war
java -jar jenkins.war --httpPort=8080

Windows

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 jenkins

Starting Jenkins

Linux (systemd)

sudo systemctl start jenkins
sudo systemctl enable jenkins   # enable at boot
sudo systemctl status jenkins   # check status

Run WAR manually

java -jar jenkins.war --httpPort=8080

Initial 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 enable

Enable 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.log

Uninstall Jenkins

sudo apt remove --purge jenkins   # Ubuntu/Debian
sudo rpm -e jenkins               # CentOS

Plugin 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/jenkins

Restore 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 jenkins

Future 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.

Jenkins installation illustration
Jenkins installation illustration
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

ci/cdOperationsLinuxWindowsInstallationmacOSJenkins
Ray's Galactic Tech
Written by

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!

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.