Jenkins is a powerful open-source automation server that can handle tasks like building, testing, and deploying your code. Here’s a step-by-step guide to getting Jenkins up and running on a Linux virtual server:
Step 1: Choose Your Linux Distribution Start by selecting your preferred Linux distribution. Popular choices include Ubuntu, CentOS, and Debian. Ensure your virtual server is up and running with SSH access.
Step 2: Update System Packages Connect to your virtual server via SSH and update the system packages to the latest versions:
sudo apt update && sudo apt upgrade -y
Step 3: Install Java Jenkins is built on Java, so you’ll need to install Java Development Kit (JDK). For example, on Ubuntu, you can use:
sudo apt install openjdk-11-jdk -y
Step 4: Add Jenkins Repository Add the Jenkins repository to your package manager’s sources list:
wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
Step 5: Install Jenkins Install Jenkins using your package manager:
sudo apt update
sudo apt install jenkins -y
Step 6: Start Jenkins Start the Jenkins service and enable it to start on boot:
sudo systemctl start jenkins
sudo systemctl enable jenkins
Step 7: Open Firewall Ports If you have a firewall, open port 8080 to access Jenkins:
sudo ufw allow 8080
Step 8: Access Jenkins You can now access Jenkins in your web browser by navigating to:
http://your-server-ip-or-domain:8080
Step 9: Unlock Jenkins To unlock Jenkins, retrieve the initial admin password from your server:
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
Follow the on-screen instructions to complete the setup.
Step 10: Install Plugins Choose the recommended plugins or select custom plugins to install.
That’s it! You’ve successfully set up Jenkins on your Linux virtual server. Now, you can configure Jenkins to automate your CI/CD pipelines and enhance your development workflow. Automation made easy thanks to Jenkins.