A Step-by-Step Guide to Installing Jenkins on an Ubuntu Linux Machine
Are you looking to set up Jenkins, the popular open-source automation server, on your Ubuntu Linux machine? In this comprehensive guide, we'll walk you through the step-by-step process of installing Jenkins to streamline your continuous integration and continuous delivery (CI/CD) workflows.
Prerequisites: Before we begin, ensure that you have the following prerequisites:
A machine running Ubuntu Linux (preferably a Long-Term Support release).
Java Development Kit (JDK) installed and configured.
Step 1: Update Package Repository: First, update the package repository on your Ubuntu machine to ensure you have access to the latest packages and dependencies.
sudo apt update
Step 2: Install Java Development Kit (JDK): Jenkins requires Java to run. Install the OpenJDK package, which is compatible with Jenkins.
sudo apt install fontconfig openjdk-17-jre
Step 3: Add Jenkins Repository Key: To ensure secure installation, add the Jenkins repository key to your system.
sudo wget -O /usr/share/keyrings/jenkins-keyring.asc \
https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key
Step 4: Add Jenkins Repository: Next, add the Jenkins repository to your system's list of software sources.
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
https://pkg.jenkins.io/debian-stable binary/ | sudo tee \
/etc/apt/sources.list.d/jenkins.list > /dev/null
Step 5: Install Jenkins: Now, install Jenkins using the apt package manager.
sudo apt-get install jenkins
Step 6: Start Jenkins Service: After installation, start the Jenkins service and enable it to start automatically on system boot.
sudo systemctl start jenkins
sudo systemctl enable jenkins
Step 7: Access Jenkins Web Interface: Once Jenkins is up and running, access the Jenkins web interface using your web browser. Navigate to http://your_server_ip_or_domain:8080
to begin the Jenkins setup process.
Step 8: Unlock Jenkins: During the initial setup, Jenkins will prompt you to unlock the Jenkins instance by retrieving the initial administrator password. Follow the on-screen instructions to locate and enter the administrator password.
Step 9: Install Recommended Plugins: After unlocking Jenkins, choose the option to install recommended plugins. This will install essential plugins to get started with Jenkins.
Step 10: Create Admin User: Create an administrator user account for Jenkins, providing the necessary details such as username, password, and email address.
Step 11: Configure Jenkins URL: Configure the Jenkins URL based on your server's IP address or domain name.
Step 12: Start Using Jenkins: Once the initial setup is complete, you can start using Jenkins to create jobs, automate build processes, and orchestrate CI/CD pipelines.
Congratulations! You've successfully installed Jenkins on your Ubuntu Linux machine. Get ready to supercharge your software development workflow with Jenkins.
For more detailed instructions and options, refer to the official Jenkins documentation for installing Jenkins on Debian/Ubuntu.
Subscribe to my newsletter
Read articles from Pratik Naik directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by