Setting Up Jenkins on Ubuntu 20.04
Embarking on the journey of integrating Jenkins into your Ubuntu 20.04 environment heralds a stride toward streamlined automation and robust DevOps practices. Jenkins, the stalwart of continuous integration and deployment, empowers teams with its versatility and extensibility. In this detailed guide, we’ll navigate the maze of installation steps, ensuring a seamless setup that unlocks the transformative potential of Jenkins within your system.
Preparing Your Ubuntu Environment
To set the stage for Jenkins, fortify your Ubuntu system with the prerequisite software packages. Begin by updating the package index to align with the latest repository versions. Execute the commands below in your terminal:
sudo apt update
sudo apt upgrade
Next, equip your system with Java, a fundamental requirement for Jenkins. Verify if Java is installed using java -version
. If absent, install OpenJDK by executing:
sudo apt install openjdk-11-jdk
Adding Jenkins Repository and Installing
To ensure a hassle-free Jenkins installation, add its repository to the system’s list of sources. Employ the wget
command to retrieve the repository’s GPG key:
wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
Proceed to append the Jenkins repository URL to the sources list:
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
Refresh the package index once more to include Jenkins from the added repository:
sudo apt update
Finally, install Jenkins by executing:
sudo apt install jenkins
Starting and Accessing Jenkins
With Jenkins now nestled within your system, initiate its service using:
sudo systemctl start jenkins
sudo systemctl enable jenkins
To access Jenkins’ web interface, verify its service status:
sudo systemctl status jenkins
Head over to your browser and type in http://your_server_ip_or_domain:8080
. Retrieve the initial administrative password from the specified file using:
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
Paste the obtained password into the Jenkins interface to complete the setup wizard, customizing your installation per your preferences.
Securing Jenkins and Configuring Plugins
Safeguard your Jenkins instance by setting up security measures. Within the Jenkins dashboard, navigate to “Manage Jenkins” > “Configure Global Security.” Select “Enable Security” and opt for “Jenkins’ own user database.” Establish an administrator account and adhere to password guidelines for robust access control.
Extend Jenkins’ functionality by integrating plugins. Navigate to “Manage Jenkins” > “Manage Plugins.” Under the “Available” tab, explore and select plugins pertinent to your workflow. Install desired plugins and relish the expanded capabilities Jenkins offers.
Conclusion
Jenkins now stands tall in your Ubuntu 20.04 fortress, an orchestrator of automation and a facilitator of seamless integration and deployment pipelines. Harness its power, explore its features, and mold it to suit the unique contours of your development landscape. The journey doesn’t end here; it unfolds, allowing you to pave paths of innovation and efficiency with Jenkins as your trusted ally.