Install Jenkins on Ubuntu
Jenkins is an open source automation server. It helps automate the parts of software development related to building, testing, and deploying, facilitating continuous integration and continuous delivery.
Jenkins is a Java Application. So you need to install JRE (Java Runtime Environment). Install it with
1 |
sudo apt-get install default-jre |
You can find instructions for installing Jenkins on Debian/Ubuntu at
https://pkg.jenkins.io/debian-stable/
Install Jenkins
1 2 3 4 |
wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add - sudo sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list' sudo apt-get update sudo apt-get install jenkins |
Enable Jenkins to start on boot
1 |
sudo systemctl enable jenkins |
Start Jenkins
1 |
sudo systemctl start jenkins |
To check status
1 |
sudo systemctl status jenkins |
You can verify Jenkins running on port 8080 with command
1 2 3 4 5 6 7 8 |
root@jenkins:~# netstat -lntp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 186/systemd-resolve tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 256/sshd: /usr/sbin tcp6 0 0 :::22 :::* LISTEN 256/sshd: /usr/sbin tcp6 0 0 :::8080 :::* LISTEN 4774/java root@jenkins:~# |
To find the initial password, run the command
1 |
cat /var/lib/jenkins/secrets/initialAdminPassword |