
{{ $('Map tags to IDs').item.json.title }}
How to Install Jenkins
Jenkins is a leading open-source automation server that supports building, deploying, and automating projects. It’s essential for achieving Continuous Integration and Continuous Deployment (CI/CD) in software development workflows.
Prerequisites
- A server with a supported Linux distribution (e.g., Ubuntu, Red Hat).
- Java Development Kit (JDK) installed (Jenkins requires at least Java 8).
- A user account with sudo access.
Step-by-Step Installation
Step 1: Update Your System
Before starting, ensure your system packages are up-to-date:
sudo apt update && sudo apt upgrade
Step 2: Install Java
Install the latest Java OpenJDK package using:
sudo apt install openjdk-11-jdk
Verify the installation:
java -version
Step 3: Add Jenkins Repository
Jenkins isn’t available through default repositories. Add the official Jenkins repository:
- First, add the GPG key:
wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
- Add the Jenkins repository to the sources list:
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
Step 4: Install Jenkins
Update your package manager and install Jenkins:
sudo apt update
sudo apt install jenkins
Step 5: Start and Enable Jenkins
Jenkins should start automatically after installation. You can enable it to start at boot:
sudo systemctl start jenkins
sudo systemctl enable jenkins
Step 6: Configure Jenkins
Open a web browser and visit Jenkins on port 8080:
http://your_server_ip_or_domain:8080
You’ll see a page to unlock Jenkins. Retrieve the one-time password by:
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
Enter this password into the setup page to continue.
Troubleshooting
- If Jenkins does not start, check the service status:
sudo systemctl status jenkins
- Inspect logs for more details:
sudo tail -f /var/log/jenkins/jenkins.log
Finalizing Setup
Once logged in, follow the on-screen instructions to complete the setup, including plugin installation and creating an admin user.
Summary Checklist
- Ensure Java is installed.
- Add and configure Jenkins repository.
- Install and start Jenkins service.
- Access Jenkins via web and complete the setup.