January 22, 2020
January 22, 2020
Jenkins is an open source continuous integration (CI) and continuous delivery (CD) tool built in Java. Jenkins basically builds, tests and deploy software projects. It’s one of the most useful development tools you can master, that’s why today we’ll show you how to install Jenkins on Ubuntu 18.04. Empower your VPS server with this powerful tool!
Jenkins is loved by teams of different sizes, for projects with various languages such as Java, Ruby, Dot Net, PHP, etc. Jenkins is an independent platform, which means you can use it on Windows, Linux or any other operating system.
In order to understand Jenkins, you must have an understanding of Continuous Integration (CI) and Continuous Delivery (CD):
Developers regularly update the code in the shared repository (such as GitHub or TFS). In nightly builds, changes made in the source code throughout the day are built together at the end of the day, making it hard to find the errors. This is where Jenkins comes in
As soon as a developer commits any change to the shared repository, Jenkins will immediately trigger a build, and in case of an error, immediately notify (Continuous Integration CI).
With Jenkins, we can also set post-build tests (unit test, performance test, acceptance test) in an automated manner. Whenever there is a successful build, Jenkins will perform these tests and generate a report (Continuous Delivery CD).
With Jenkins you get support for different version control systems, code quality metrics, build notifiers, UI customization, and more!
Now it’s time to learn how you can start using Jenkins on your Ubuntu 18.04 machine or server:
Access your VPS using SSH. If you’re having trouble, check out our PuTTY tutorial!
The first Jenkins prerequisite is JDK. The following command will install JDK and JRE:
sudo apt-get install openjdk-8-jdk
The next thing you need is a Web server like Apache or Nginx. You can install any Web server of your choice. For this tutorial we’ll use Nginx. To install Nginx on your VPS, execute the following command in the command line:
sudo apt-get install nginx
Make sure Nginx is up and running on your Ubuntu based machine by typing in your server’s IP in your web browser and hitting enter. You should be greeted by the Nginx welcome screen.
Next we will install Jenkins. Issue the following four commands in sequence to install Jenkins on Ubuntu:
wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo apt-get install jenkins
By default Jenkins will run on port 8080. To start Jenkins type in the IP of your VPS and the port number 8080. It would look something like this in your browser – 220.127.116.11:8080.
You will be asked to enter the administrator password. You can find the password in the /var/lib/jenkins/secrets/initialAdminPassword file. You can use the cat command to display the password:
Copy the password to the Administrator password field and press enter.
Next, you will see following screen, where we recommend you install the suggested plugins.
Next, you can set username and password on following screen. After that you will be taken to the Jenkins dashboard, where you can begin working!
It’s really that simple to install Jenkins on Ubuntu. Jenkins as a whole has a low learning curve and, meaning you can start working with it as soon as possible. We hope this tutorial helps improve the development of your project! Good luck!
February 16 2020
Very Nice! Much Appreciated For Your Effort to Post this here!