Jenkins is a Java-based open source continuous integration and continuous delivery solution. Jenkins is a software development tool that develops, tests, and deploys software applications. It’s one of the most important development tools you’ll ever find yourself using.
In this article, we will be guiding you on how to install Jenkins onto your Linux based VPS. The Linux distribution used here is Ubuntu 18.04
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.
<VPS_IP_Address>:<Jenkin_port>
An example of the format above would be “120.0.0.1:8080”. Type it into your web browser and run it. You should be prompted to enter the administrator password, which they will provide the directory to find the password, which is “/var/lib/jenkins/secrets/initialAdminPassword”. Use the following command to display the password.
cat /var/lib/jenkins/secrets/initialAdminPassword
Copy the password and paste it in the field that requested for the administrator password.
Step 5: Configuration
Finally, go through the following screens to set up Jenkins. It is recommended to install the plugins suggested to you, then set up the user’s information. You will be directed to the Jenkins dashboard once you are done setting them up.