Installation guides

Installing Jenkins on Debian

Step-by-Step Guide

  1. Update the Package Index
    Open a terminal and update the package index to ensure you have the latest information about available packages:
   sudo apt update
  1. Install Java
    Jenkins requires Java to run. Install OpenJDK, which is a free and open-source implementation of the Java Platform:
   sudo apt install openjdk-11-jdk

Verify the Java installation:

   java -version
  1. Add Jenkins Repository
    Add the Jenkins repository key to your system:
   curl -fsSL https://pkg.jenkins.io/debian/jenkins.io.key | sudo tee /usr/share/keyrings/jenkins-keyring.asc > /dev/null

Add the Jenkins repository to your sources list:

   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
  1. Update the Package Index Again
    Update the package index to include the Jenkins repository:
   sudo apt update
  1. Install Jenkins
    Install Jenkins using the apt package manager:
   sudo apt install jenkins
  1. Start and Enable Jenkins
    Start the Jenkins service:
   sudo systemctl start jenkins

Enable Jenkins to start on boot:

   sudo systemctl enable jenkins
  1. Verify Jenkins Installation
    Check the Jenkins service status to ensure it is running:
   sudo systemctl status jenkins

If Jenkins is running, you should see an active (running) status.

  1. Adjust the Firewall
    Ensure that your firewall allows traffic on port 8080, which is the default port for Jenkins. If you are using UFW, you can allow traffic with:
   sudo ufw allow 8080
   sudo ufw status
  1. Access Jenkins Web Interface
    Open your web browser and navigate to http://your_server_ip:8080. You should see the Jenkins unlock screen.
  2. Unlock Jenkins
    Retrieve the initial administrator password by running the following command: sudo cat /var/lib/jenkins/secrets/initialAdminPassword Copy the password and paste it into the “Administrator password” field in the Jenkins web interface.
  3. Install Suggested Plugins
    After unlocking Jenkins, you will be prompted to install plugins. Click on “Install suggested plugins” to start the installation process.
  4. Create First Admin User
    Once the plugins are installed, you will be prompted to create the first admin user. Fill in the required information and click “Save and Finish”.
  5. Start Using Jenkins
    After creating the admin user, Jenkins is ready to use. Click on “Start using Jenkins” to access the Jenkins dashboard.
  6. Configure Jenkins (Optional)
    Configure Jenkins according to your needs. You can install additional plugins, set up credentials, and configure global settings from the Jenkins dashboard.
  7. Set Up a Simple Job (Optional)
    To set up a simple job, click on “New Item” in the Jenkins dashboard, enter a name for your job, select “Freestyle project”, and click “OK”. Configure the job settings and click “Save”. To run the job, click on “Build Now”.
Other Recent Posts