Info: This post is one of the article in context of this post: Huawei Cloud ECS server notes
Install firstly Java:
sudo apt update
sudo apt install openjdk-8-jdk
Add official Jenkins source key into Ubuntu source:
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'
Update apt source and install Jenkins:
sudo apt update
sudo apt install jenkins
Service Jenkins shall automatically start once the installation finishes. One can check its status using:
systemctl status jenkins
or
serviec jenkins status
We can use systemctl
cmd to stop/start/restart jenkins service.
Default port of Jenkins is 8080, thus one can visit Jenkins in browser via address: http://localhost:8080/. In order to change default port of Jenkins, one should modify file /etc/default/jenkins:
vim /etc/default/jenkins
Change HTTP_PORT to his/her expected port id:
# port for HTTP connector (default 8080; disable with -1)
HTTP_PORT=8080
Jenkins requires the default password when user logs in for ths first time. The initial Password can be viewed using:
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
Top comments (0)