Linux
Jenkins installers are available for several Linux distributions.
Unresolved include directive in modules/installing/pages/linux.adoc - include::doc/book/installing/_installation_requirements.adoc[]
Debian/Ubuntu
On Debian and Debian-based distributions like Ubuntu you can install Jenkins through apt
.
Long Term Support release
A LTS (Long-Term Support) release is chosen every 12 weeks from the stream of regular releases as the stable release for that time period.
It can be installed from the debian-stable
apt repository.
curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io.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-get update
sudo apt-get install jenkins
Weekly release
A new release is produced weekly to deliver bug fixes and features to users and plugin developers.
It can be installed from the debian
apt repository.
curl -fsSL https://pkg.jenkins.io/debian/jenkins.io.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 binary/ | sudo tee \
/etc/apt/sources.list.d/jenkins.list > /dev/null
sudo apt-get update
sudo apt-get install jenkins
Beginning with Jenkins 2.335 and Jenkins 2.332.1, the package is configured with systemd
rather than the older System V init
.
See the DigitalOcean community systemd
tutorial to better understand the benefits of systemd
and the systemctl
command.
The package installation will:
-
Setup Jenkins as a daemon launched on start. Run
systemctl cat jenkins
for more details. -
Create a ‘jenkins’ user to run this service.
-
Direct console log output to
systemd-journald
. Runjournalctl -u jenkins.service
if you are troubleshooting Jenkins. -
Populate
/lib/systemd/system/jenkins.service
with configuration parameters for the launch, e.gJENKINS_HOME
-
Set Jenkins to listen on port 8080. Access this port with your browser to start configuration.
If Jenkins fails to start because a port is in use,
run
Here, "8081" was chosen but you can put another port available. |
Installation of Java
Jenkins requires Java in order to run, yet certain distributions don’t include this by default and some Java versions are incompatible with Jenkins.
There are multiple Java implementations which you can use. OpenJDK is the most popular one at the moment, we will use it in this guide.
Update the Debian apt repositories, install OpenJDK 11, and check the installation with the commands:
$ sudo apt update
$ sudo apt install openjdk-11-jre
$ java -version
openjdk version "11.0.12" 2021-07-20
OpenJDK Runtime Environment (build 11.0.12+7-post-Debian-2)
OpenJDK 64-Bit Server VM (build 11.0.12+7-post-Debian-2, mixed mode, sharing)
Why use |
Fedora
You can install Jenkins through dnf
. You need to add the Jenkins repository from the Jenkins website to the package manager first.
Long Term Support release
A LTS (Long-Term Support) release is chosen every 12 weeks from the stream of regular releases as the stable release for that time period.
It can be installed from the redhat-stable
yum repository.
sudo wget -O /etc/yum.repos.d/jenkins.repo \
https://pkg.jenkins.io/redhat-stable/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
sudo dnf upgrade
# Add required dependencies for the jenkins package
sudo dnf install java-11-openjdk
sudo dnf install jenkins
sudo systemctl daemon-reload
Weekly release
A new release is produced weekly to deliver bug fixes and features to users and plugin developers.
It can be installed from the redhat
yum repository.
sudo wget -O /etc/yum.repos.d/jenkins.repo \
https://pkg.jenkins.io/redhat/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat/jenkins.io.key
sudo dnf upgrade
# Add required dependencies for the jenkins package
sudo dnf install java-11-openjdk
sudo dnf install jenkins
Start Jenkins
You can enable the Jenkins service to start at boot with the command:
sudo systemctl enable jenkins
You can start the Jenkins service with the command:
sudo systemctl start jenkins
You can check the status of the Jenkins service using the command:
sudo systemctl status jenkins
If everything has been set up correctly, you should see an output like this:
Loaded: loaded (/lib/systemd/system/jenkins.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2018-11-13 16:19:01 +03; 4min 57s ago
If you have a firewall installed, you must add Jenkins as an exception.
You must change
|
Red Hat / CentOS
You can install Jenkins through yum
on Red Hat Enterprise Linux, CentOS, and other Red Hat based distributions.
You need to choose either the Jenkins Long Term Support release or the Jenkins weekly release.
Long Term Support release
A LTS (Long-Term Support) release is chosen every 12 weeks from the stream of regular releases as the stable release for that time period.
It can be installed from the redhat-stable
yum repository.
sudo wget -O /etc/yum.repos.d/jenkins.repo \
https://pkg.jenkins.io/redhat-stable/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
sudo yum upgrade
# Add required dependencies for the jenkins package
sudo yum install java-11-openjdk
sudo yum install jenkins
sudo systemctl daemon-reload
Weekly release
A new release is produced weekly to deliver bug fixes and features to users and plugin developers.
It can be installed from the redhat
yum repository.
sudo wget -O /etc/yum.repos.d/jenkins.repo \
https://pkg.jenkins.io/redhat/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat/jenkins.io.key
sudo yum upgrade
# Add required dependencies for the jenkins package
sudo yum install java-11-openjdk
sudo yum install jenkins
Start Jenkins
You can enable the Jenkins service to start at boot with the command:
sudo systemctl enable jenkins
You can start the Jenkins service with the command:
sudo systemctl start jenkins
You can check the status of the Jenkins service using the command:
sudo systemctl status jenkins
If everything has been set up correctly, you should see an output like this:
Loaded: loaded (/lib/systemd/system/jenkins.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2018-11-13 16:19:01 +03; 4min 57s ago
...
If you have a firewall installed, you must add Jenkins as an exception.
You must change
|
Unresolved include directive in modules/installing/pages/linux.adoc - include::doc/book/installing/_setup-wizard.adoc[]