Jenkins is an open source continuous integration and delivery system built on Java. Jenkins is a tool for developing, testing, and deploying software applications. One of the most crucial development tools you’ll ever use is this one.
We’ll show you how to install Jenkins on your Linux-based VPS in this article. Here, Ubuntu 18.04 is the Linux operating system.
Step 1: Install JDK
Before making any installation, be sure to access your VPS using SSH. Then start by installing JDK, which is a prerequisite of Jenkins, using the following command in your terminal.
sudo apt-get install openjdk-8-jdk
Step 2: Install Web Server
Install a web server according to your own preference such as Apache or Nginx. In this guide, we will be installing Nginx using the following command.
sudo apt-get install nginx
To verify if the Nginx installation is successful or not, type in your server’s IP address into the web browser and run it You will be able to see a welcome page by Nginx if the installation is done properly.
Step 3: Jenkins Installation
To install Jenkins, run the following commands one by one in an orderly manner.
wget -q -0 - https://pkg.jenkins.io/debian/jenkins-ci.org.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
The commands above help you download the Jenkins packages from the official page and update your repositories before installing Jenkins into your VPS.
Step 4: Enter Administrator Password
Jenkins will run on port 8080 by default. To start Jenkins, type in the IP address of your VPS, follow by the port number Jenkin is running on, which is port 8080, in the following format.
“184.108.40.206:8080” is an illustration of the above format. Run it by typing it into your web browser. You should be asked to provide the administrator password, which is located in the directory “/var/lib/jenkins/secrets/initialAdminPassword,” which they will offer. To view the password, enter the following command.
Copy the password and paste it in the field that requested for the administrator password.
Step 5: Configuration
Finally, set up Jenkins by going through the next stages. Installing the plugins that were recommended to you is advised before configuring the user’s information. Once you have finished setting them up, you will be taken to the Jenkins dashboard.