How To Install Jenkins on Ubuntu 18.04
Installing Jenkins
To install Jenkins on your Ubuntu system, follow these steps:
- Install Java.Since Jenkins is a Java application, the first step is to install Java. Update the package index and install the Java 8 OpenJDK package with the following commands:
sudo apt updatesudo apt install openjdk-8-jdk
The current version of Jenkins does not support Java 10 (and Java 11) yet. If you have multiple versions of Java installed on your machine make sure Java 8 is the default Java version. - Add the Jenkins Debian repository.Import the GPG keys of the Jenkins repository using the following
wget
command:wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
The commands above should outputOK
which means that the key has been successfully imported and packages from this repository will be considered trusted.Next, add the Jenkins repository to the system with:sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
- Install Jenkins.Once the Jenkins repository is enabled, update the
apt
package list and install the latest version of Jenkins by typing:sudo apt updatesudo apt install jenkins
Jenkins service will automatically start after the installation process is complete. You can verify it by printing the service status:systemctl status jenkins
You should see something similar to this:● jenkins.service - LSB: Start Jenkins at boot time Loaded: loaded (/etc/init.d/jenkins; generated) Active: active (exited) since Wed 2018-08-22 13:03:08 PDT; 2min 16s ago Docs: man:systemd-sysv-generator(8) Tasks: 0 (limit: 2319) CGroup: /system.slice/jenkins.service
Adjusting FirewallIf you are installing Jenkins on a remote Ubuntu server that is protected by a firewall you’ll need to open port 8080
. Assuming you are using UFW
to manage your firewall, you can open the port with the following command:
https://linuxize.com/post/how-to-install-jenkins-on-ubuntu-18-04/
No comments:
Post a Comment