Debian/Ubuntu
On Debian-based distributions, such as Ubuntu, you can install Jenkins through apt
.
Recent versions are available in an apt repository. Older but stable LTS versions are in this apt repository.
wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo apt-get install jenkins
This package installation will:
-
Setup Jenkins as a daemon launched on start. See
/etc/init.d/jenkins
for more details. -
Create a ‘jenkins’ user to run this service.
-
Direct console log output to the file
/var/log/jenkins/jenkins.log
. Check this file if you are troubleshooting Jenkins. -
Populate
/etc/default/jenkins
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 your
/etc/init.d/jenkins
file fails to start Jenkins, edit the/etc/default/jenkins
to replace the line----HTTP_PORT=8080----
with----HTTP_PORT=8081----
Here, "8081" was chosen but you can put another port available.
网友评论