How to install and configure Jenkins on Ubuntu 18.04?
Jenkins is a popular open-source automation server that helps to automate the building, testing, and deployment of software applications. It provides a variety of plugins that support the integration of various tools and technologies into the development pipeline. In this article, we will learn how to install and configure Jenkins on Ubuntu 18.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: Install Java
Jenkins requires Java to be installed on the system. Run the following command to install Java on Ubuntu
sudo apt-get update
sudo apt-get install default-jdk
Step 2: Add the Jenkins repository key
To install Jenkins, we need to add its repository key to the apt package manager. Run the following command to add the key
wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
Step 3: Add the Jenkins repository
After adding the key, we need to add the Jenkins repository to the apt sources list. Run the following command to add the repository
sudo sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
Step 4: Install Jenkins
To install Jenkins, run the following command
sudo apt-get update
sudo apt-get install jenkins
Step 5: Start Jenkins
After installing Jenkins, start the service using the following command
sudo systemctl start jenkins
Step 6: Verify the installation
To verify that Jenkins is running, open a web browser and enter the following URL
http://your_server_ip:8080
If everything works fine, you should see the Jenkins login page.
Step 7: Configure Jenkins
After verifying the installation, you need to configure Jenkins. Follow the steps below,
Copy the initial administrator password from the following file
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
Paste the password into the Jenkins login page and click "Continue."
Choose "Install suggested plugins" and wait for the plugins to install.
Create an administrator user account.
Choose the URL for Jenkins and click "Save and Finish."
Finally, click "Start using Jenkins" to access the Jenkins dashboard.
Conclusion
In this article, we learned how to install and configure Jenkins on Ubuntu 18.04. Jenkins is a powerful tool that can automate the development pipeline and improve the efficiency of your development process. With Jenkins, you can easily integrate various tools and technologies into your pipeline and ensure that your applications are built, tested, and deployed consistently.
Comments
Post a Comment
Comments are always welcome, that will help us to motivate ourselves and improve our services. Thanks!!