How To Install Jenkins on Ubuntu Machine

Jenkins Install Ubuntu Techhyme

Jenkins is an open-source automation server that helps automate parts of the software development process such as building, testing, and deploying software. It can be used to automate any task that can be scripted or run via a command-line interface.

Jenkins is highly extensible and supports a wide range of plugins that can be used to enhance its functionality. It can integrate with many different tools and technologies, such as version control systems, build tools, testing frameworks, and deployment tools.

Jenkins is widely used in the software development industry for its ease of use, flexibility, and robustness. It allows developers to automate routine tasks, reduce errors, and improve the overall efficiency of the development process.

Before you dive into the installation of Jenkins on your Ubuntu machine, you will need Java as a prerequisite and can be install by using the following command:

Command: apt install default-jdk

Jenkins Install Ubuntu Techhyme

To verify the java version on your machine, you can type:

Command: java -version

Jenkins Install Ubuntu Techhyme

Or you can also use “which java” command which gives you the location of java.

Jenkins Install Ubuntu Techhyme

Now that you have Java installed on your Ubuntu machine. Now, it’s time to install Jenkins, an easier and more straightforward task.

First, update your system packages on the Ubuntu machine using the below command.

Command: apt update

Jenkins Install Ubuntu Techhyme

Now add Jenkins Public key to your system so that this key can trust the jenkins.io site to download the repository or any packages.

Command: wget -q -O – https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add –

Jenkins Install Ubuntu Techhyme

Now, add the Jenkins repository to your system and update your system.

Command: sh -c ‘echo deb https://pkg.jenkins.io/debian-stable binary/ > \ /etc/apt/sources.list.d/jenkins.list’

Jenkins Install Ubuntu Techhyme

Type “apt-get update” to update all the packages.

Jenkins Install Ubuntu Techhyme

Now install the Jenkins package using the apt-get command.

Command: apt-get install jenkins

Jenkins Install Ubuntu Techhyme

To check the status of jenkins, you can use:

Command: service jenkins status

Jenkins Install Ubuntu Techhyme

Now that you have installed Jenkins on your Ubuntu machine successfully and verified by running the service command. But the installation is just an initial stage; you will need to set the Jenkins to make it work properly.

Open the Jenkins instance on your favorite web browser by going to localhost:8080.

As soon as the URL is opened, it will prompt for the administrator password.

Jenkins Install Ubuntu Techhyme

The password can be found on /var/lib/jenkins/secrets/initialAdminPassword directory, as shown below.

Command: cat /var/lib/jenkins/secrets/initialAdminPassword

Jenkins Install Ubuntu Techhyme

After successfully adding the Jenkins admin password, you will be prompted for Plugins installation.

We will select the Install Suggested Plugins option as shown below.

Jenkins Install Ubuntu Techhyme

Once the plugins are successfully installed, then it will prompt to create a First admin user.

Jenkins Install Ubuntu Techhyme

Please fill in the required information and keep it safe with you, as you will use this later to log in.

Jenkins Install Ubuntu Techhyme

Now Jenkins URL configuration screen will appear, and you can keep the default URL as it is and click on save and finish.

Jenkins Install Ubuntu Techhyme

Now Jenkins instance is ready for use. Click “Start using Jenkins.” After you click, you will see Jenkins Dashboard, where you create New Jobs by clicking on New Item.

Jenkins Install Ubuntu Techhyme

 

You may also like:

Related Posts

Leave a Reply