Chapter 2: Installing and Deploying Jenkins Server
This guide details the complete process of installing Jenkins Server, covering prerequisite Java installation, multiple deployment methods—including Tomcat, CentOS, macOS, Docker, Kubernetes, and Windows—followed by essential post‑installation configuration and resource links.
Chapter 2: Installing and Deploying Jenkins Server
This chapter explains how to install and deploy a Jenkins Server using various environments and deployment methods, and provides basic configuration steps after installation.
1.1 Install Dependencies
Jenkins is a Java‑based CI tool; it requires JDK 8+ (JDK 11 is also supported). Install the JDK via RPM or source packages.
rpm -ivh jdk-xxxxx.rpm yum -y install java-1.8.0-openjdk java-1.8.0-openjdk-develOr install from a source tarball:
tar zxf jdk-xxxx.tar.gz -C /usr/local vim /etc/profile export JAVA_HOME=/usr/local/jdkxxx export PATH=$PATH:$JAVA_HOME/bin source /etc/profile1.2 Installation and Deployment
1.2.1 Deploy with Tomcat
Download and extract Tomcat, then copy jenkins.war into the webapps directory and start Tomcat.
wget http://mirror.bit.edu.cn/apache/tomcat/tomcat-9/v9.0.24/bin/apache-tomcat-9.0.24.tar.gz tar xf apache-tomcat-9.0.24.tar.gz -C /usr/local/ cp jenkins.war apache-tomcat-9.0.24/webapps/ # start
/usr/local/tomcat/bin/catalina.sh start
# stop
/usr/local/tomcat/bin/shutdown.sh1.2.2 Deploy on CentOS
Install the latest Jenkins RPM package and enable the service.
wget https://mirrors.tuna.tsinghua.edu.cn/jenkins/redhat-stable/jenkins-2.235.2-1.1.noarch.rpm rpm -ivh jenkins-2.235.2-1.1.noarch.rpm systemctl start jenkins systemctl enable jenkins1.2.3 Deploy on macOS
Install Jenkins via Homebrew or download the PKG installer. brew install jenkins-lts After installation, start the service:
brew services start jenkins-lts1.2.4 Deploy with Docker
Pull the official Jenkins LTS image and run it with persistent storage.
docker pull jenkins/jenkins:lts docker run -d -v jenkins_home:/var/jenkins_home -p 8080:8080 -p 50000:50000 jenkins/jenkins:lts1.2.5 Deploy on Kubernetes
Create a namespace and apply the provided YAML manifest. kubectl create -f jenkins.yml Key parts of the manifest include a Deployment, ServiceAccount, Role, and Service exposing ports 30080 (web) and 30081 (agent). Persistent storage is defined via a hostPath volume (suitable for testing).
1.2.6 Deploy on Windows
Download the Windows installer package and follow the wizard; this method is rarely used now.
1.2.7 Resource Downloads
Links are provided for JDK, macOS PKG, Jenkins WAR, RPM, Docker Hub, Kubernetes YAML, and Windows installer.
1.3 Configuration
After first launch, unlock Jenkins using the password from $JENKINS_HOME/secrets/initialAdminPassword or the startup log.
Install the default plugin set (or select custom plugins), create an admin user, and configure the update site. To improve update speed, replace the default update URL with a mirror (e.g., Tsinghua University) using one of three methods: install the Chinese community plugin, configure an Nginx proxy, or edit default.json directly.
Typical Linux configuration resides in /etc/sysconfig/jenkins, with the default user jenkins and port 8080. Adjust these settings as needed.
With Jenkins installed and configured, the server is ready for further tasks such as adding agent nodes.
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.
DevOps Cloud Academy
Exploring industry DevOps practices and technical expertise.
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.
