Jenkins is an open-source automation server. Continuous integration and continuous delivery are made possible by automating the software development processes of developing, testing, and deploying. It is a server-based program that runs on Apache Tomcat or another servlet container.
Prerequisites:
- A server or virtual machine running Ubuntu Linux (or another Linux distribution of your choice).
- SSH access to the server with sudo privileges
- Basic knowledge of using the command line
Here’s a step-by-step guide to installing Jenkins:
- Update the repository for packages:
- Use SSH to connect to your server.
- To make sure you’re dealing with the most recent package information, update the package repository:
sudo apt update
- Install Java:
- Because Jenkins is written in Java, the Java Runtime Environment (JRE) must be installed on your server. OpenJDK is widely employed.
sudo apt install openjdk-11-jre
#verify java instllation
java -version
- Add Jenkins Repository and Key:
- Jenkins offers an official Ubuntu repository. Include the Jenkins repository key and URL for the repository:
wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
- Add the Jenkins repository:
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
- Install Jenkins:
- Update the package list, then set up Jenkins:
sudo apt update
sudo apt install jenkins
Jenkins installation is complete in Linux/Ubuntu
- Start and Enable Jenkins:
- Launch the Jenkins service and make it boot-up-ready:
sudo systemctl start jenkins
sudo systemctl enable jenkins
- Open the firewall port, if necessary:
- Open port 8080 on your server’s firewall (such as the UFW) to permit outside access to Jenkins:
sudo ufw allow 8080
- Launch the Jenkins Web Interface:
- Navigate to your server’s IP address or domain followed by port 8080 (http://your_server_ip_or_domain:8080/) in a web browser.
- Jenkins will be asked to be unlocked. Retrieve your server’s initial admin password:
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
#Copy the password and paste it into the Jenkins web interface to unlock Jenkins.
- Install Recommended Plugins:
- During setup, select the “Install suggested plugins” option. The most widely used Jenkins plugins will be installed.
- Create an Administrator User:
- To create an admin user for Jenkins, follow the on-screen steps.
- Setup Jenkins:
- Configure Jenkins according to your specific environment and requirements. This involves specifying the Jenkins URL and, if required, configuring email notifications.
- Begin Using Jenkins: You can now begin automating your CI/CD operations by establishing jobs and pipelines in Jenkins.
That’s all! Jenkins has been installed successfully on your Ubuntu server. You may use your web browser to access Jenkins and begin configuring your CI/CD pipelines and tasks to automate your development processes.
Arjun is a Full-stack developer, who is fond of the web. Lives in Chikmagalur, Karnataka, India