Comprehensive Guide: Jenkins Server Installation on Debian 12
In this article, you will learn how to perform a Jenkins Server Installation on Debian 12 Bookworm. Jenkins is a powerful open-source automation server that streamlines the software development process. It is widely used for building, testing, and deploying software projects. By leveraging Jenkins, you can automate various tasks, including compiling code, executing tests, and deploying applications, thereby enhancing efficiency and reducing manual errors.
You can now follow the rest of the article to start your Jenkins Server installation and configuration on Debian 12 Bookworm.
A Step-by-Step Guide For Jenkins Server Installation on Debian 12
Before embarking on your Jenkins server setup, ensure you have access to your server as a non-root user with sudo privileges. Refer to the Debian 12 Initial Setup Guide if you need assistance with this.
It is also crucial to have Java installed on your server. Consult the Java Installation with APT on Debian 12 guide for instructions. Jenkins supports OpenJDK 17, which is the default Java version on Debian 12.
Once these prerequisites are met, follow the steps outlined below to complete the Jenkins Server installation on Debian 12.
Step 1. Add Jenkins Repository To Debian 12
The initial step involves adding the official Jenkins repository to your Debian 12 system. Use the following wget command to add the GPG key:
sudo wget -O /usr/share/keyrings/jenkins-keyring.asc
https://pkg.jenkins.io/debian/jenkins.io-2023.key
Next, add the long-term support version of the Jenkins repository using the following command:
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc]
https://pkg.jenkins.io/debian binary/ | sudo tee
/etc/apt/sources.list.d/jenkins.list > /dev/null
Step 2. Command to Jenkins server installation on Debian 12
After adding the repository, update your system’s package list:
sudo apt update
Then, use the following command to install Jenkins on Debian 12:
sudo apt install jenkins -y
Step 3. Start and Enable Jenkins Service on Debian 12
During the installation, the Jenkins service should be automatically enabled and activated. To verify this, execute the following command:
sudo systemctl status jenkins
The output should resemble the following:

If the service is not enabled, enable and start it with the following command:
sudo systemctl enable --now jenkins
Step 4. Display Jenkins Initial Admin Password
To access the Jenkins dashboard through the web interface on Debian 12, you will need the initial admin password. Retrieve it using the following command:
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
**Exmaple Output**
6e50220a1b304287bfa8743146a1a022
Step 5. Configure Jenkins Server Through Web UI
Access the Jenkins web interface on Debian 12 by entering your server’s IP address followed by port 8080 in your web browser:
http://<your-server-ip>:8080
This will display the Unlock Jenkins page. Enter the retrieved Jenkins initial admin password and click Continue.

Next, choose the Jenkins plugins you want to install on Debian 12. You can either select specific plugins or opt for the recommended ones. Here, we choose Install suggested plugins.

Wait for the plugin installation to complete.

After the installation, create your first admin user. This user account will be used to log in and manage Jenkins. Click Save and Continue.

Step 6. Access Jenkins Server Dashboard
After completing the preceding steps, your Jenkins Dashboard on Debian 12 will be ready, enabling you to create projects for testing and development in collaboration with your development team.
Verify Jenkins URL:

Start using Jenkins Server:

You will now see your Jenkins Server dashboard on Debian 12:

Jenkins server can perform a variety of tasks related to software development and deployment. Some of its key capabilities include:
- Continuous Integration and Continuous Delivery (CI/CD)
- Automated Builds and Testing
- Plugin Ecosystem for Extending Functionality
- Web-Based Interface for Easy Management
- Distributed Builds for Scalability
To get more info, you can visit the official docs page.
Conclusion
The Jenkins Server serves as a central hub for automating various aspects of the software development lifecycle, ultimately improving productivity, efficiency, and collaboration within development teams. At this point, you have learned Jenkins Server installation on Debian 12 Bookworm.
Hope you enjoy using it. Also, you may like to read the following articles:
Install Tesseract OCR on Debian 12 via Terminal
Comprehensive Guide To Install XWiki on Debian 12
Varnish Cache Setup with Nginx on Debian 12
TCP BBR Congestion Control Setup Guide for Debian 12
Alternative Installation Methods for Jenkins on Debian 12
While the article details a comprehensive method for installing Jenkins on Debian 12 using the official repository, there are alternative approaches that might be suitable depending on your specific needs and environment. Let’s explore two such alternatives: using Docker and using a WAR file deployment.
1. Installing Jenkins using Docker
Docker provides a containerization platform that allows you to run applications in isolated environments. This approach offers several benefits, including portability, consistency, and ease of deployment.
Explanation:
Instead of installing Jenkins directly on the Debian 12 system, you can use a Docker image that encapsulates Jenkins and its dependencies. This ensures that Jenkins runs in a consistent environment, regardless of the underlying operating system. Furthermore, Docker simplifies the process of upgrading Jenkins and managing its dependencies.
Steps:
-
Install Docker: If Docker is not already installed on your Debian 12 system, install it using the following commands:
sudo apt update sudo apt install docker.io -y sudo systemctl start docker sudo systemctl enable docker
-
Pull the Jenkins Docker image: Download the official Jenkins Docker image from Docker Hub:
sudo docker pull jenkins/jenkins:lts
This command pulls the latest Long Term Support (LTS) version of the Jenkins image.
-
Run the Jenkins container: Create and start a Jenkins container using the following command:
sudo docker run -d -p 8080:8080 -p 50000:50000 -v jenkins_home:/var/jenkins_home jenkins/jenkins:lts
-d
: Runs the container in detached mode (in the background).-p 8080:8080
: Maps port 8080 on the host to port 8080 in the container (Jenkins web UI).-p 50000:50000
: Maps port 50000 on the host to port 50000 in the container (for Jenkins agents).-v jenkins_home:/var/jenkins_home
: Creates a named volumejenkins_home
to persist Jenkins data. This is crucial for preserving your Jenkins configuration across container restarts.
-
Access Jenkins: Open your web browser and navigate to
http://<your-server-ip>:8080
. Follow the instructions from Step 4 and 5 of the original article to retrieve the initial admin password and complete the setup.
Benefits of Docker:
- Isolation: Jenkins runs in a containerized environment, preventing conflicts with other applications on the host system.
- Portability: The Jenkins Docker image can be easily deployed to different environments, ensuring consistency.
- Scalability: Docker allows you to easily scale your Jenkins infrastructure by running multiple containers.
- Simplified Upgrades: Upgrading Jenkins is as simple as pulling a new Docker image and restarting the container.
2. Deploying Jenkins using a WAR file
Another alternative is to deploy Jenkins as a web application archive (WAR) file within an existing Java application server like Tomcat or Jetty.
Explanation:
This method is useful if you already have a Java application server running on your Debian 12 system and prefer to manage Jenkins as a standard web application. This provides more control over the deployment environment and allows you to integrate Jenkins with existing infrastructure.
Steps:
-
Install a Java Application Server (e.g., Tomcat): If you don’t have one already, install Tomcat on your Debian 12 system:
sudo apt update sudo apt install tomcat9 -y sudo systemctl start tomcat9 sudo systemctl enable tomcat9
-
Download the Jenkins WAR file: Download the latest stable Jenkins WAR file from the official Jenkins website:
wget https://get.jenkins.io/war-stable/latest/jenkins.war
-
Deploy the WAR file: Copy the
jenkins.war
file to the Tomcat webapps directory:sudo cp jenkins.war /var/lib/tomcat9/webapps/
-
Restart Tomcat: Restart the Tomcat server to deploy the Jenkins application:
sudo systemctl restart tomcat9
-
Access Jenkins: Open your web browser and navigate to
http://<your-server-ip>:8080/jenkins
. (The port might differ depending on your Tomcat configuration). Follow the instructions from Step 4 and 5 of the original article to retrieve the initial admin password and complete the setup.
Benefits of WAR file deployment:
- Integration with existing infrastructure: Jenkins integrates seamlessly with existing Java application servers.
- Fine-grained control: You have more control over the deployment environment and configuration.
- Resource sharing: Jenkins can share resources with other web applications running on the same server.
Choosing the right installation method depends on your specific requirements and infrastructure. The official repository method is generally the easiest and most straightforward, while Docker provides isolation and portability, and WAR file deployment offers integration with existing Java application servers. No matter which method you choose, Jenkins Server installation on Debian 12 will significantly improve your software development workflow.