How to install and configure Jenkins on Ubuntu 22.04?

Jenkins is a powerful open-source automation server that helps to automate the build, test, and deployment of applications. It's a popular tool among developers due to its flexibility and ease of use. In this article, we will learn how to install and configure Jenkins on Ubuntu 22.04.

Prerequisites

Before we begin, make sure you have a user account with sudo privileges. If you don't have one, create one using the following command

sudo adduser your_username

After adding the user account, add the user to the sudo group using the following command

sudo usermod -aG sudo your_username

Step 1: Update the system

Before installing any new package, it's always a good practice to update the system. Run the following command to update the system

sudo apt-get update

Step 2: Install Java

Jenkins requires Java to run. To install Java on Ubuntu, run the following command

sudo apt-get install default-jdk

Step 3: Install Jenkins

To install Jenkins on Ubuntu, follow the steps below,

Add the Jenkins GPG key using the following command

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

Add the Jenkins repository to the apt sources list using the following command

sudo sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'

Update the apt package list to include the newly added repository.

sudo apt-get update

Finally, install Jenkins using the following command

sudo apt-get install jenkins

Step 4: Configure Jenkins

After the installation is complete, you can access the Jenkins web interface using your web browser. To do this, open your web browser and go to http://localhost:8080/.

You will be prompted to enter the initial admin password. The password can be found in the following file

/var/lib/jenkins/secrets/initialAdminPassword

Copy and paste the password into the web interface and click "Continue."

Next, select "Install suggested plugins" and wait for the installation to complete.

After the plugins are installed, you will be asked to create an admin user. Fill in the required fields and click "Save and Continue."

Finally, you can customize your Jenkins installation by selecting the plugins you want to use and configuring the global settings. Once you're done, click "Save and Finish" to complete the setup.

Conclusion

In this article, we learned how to install and configure Jenkins on Ubuntu 22.04. Jenkins is a powerful automation server that can simplify the build, test, and deployment of applications. With Jenkins, you can easily automate repetitive tasks and improve the efficiency of your development environment.


How to install and configure Jenkins on Ubuntu 18.04?

How to install and configure Jenkins on Ubuntu 20.04?

Comments

Popular posts from this blog

How to update build number in Azure DevOps pipeline?

How to get latest build ID from Azure DevOps pipeline?

How to install AWS System Manager (SSM) Agent on windows using PowerShell?