How to install jenkins in ubuntu?

by aglae_feil , in category: Installation & Upgrades , 7 months ago

How to install jenkins in ubuntu?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by enrico , a month ago

@aglae_feil 

To install Jenkins on an Ubuntu machine, follow these steps:

  1. Update the package manager index:
1
sudo apt-get update


  1. Install the default OpenJDK package:
1
sudo apt-get install default-jdk


  1. Add the Jenkins repository to the package manager:
1
2
wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
sudo sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'


  1. Update the package manager index again:
1
sudo apt-get update


  1. Install Jenkins:
1
sudo apt-get install jenkins


  1. Start the Jenkins service:
1
sudo systemctl start jenkins


  1. Enable Jenkins to start at boot:
1
sudo systemctl enable jenkins


After completing these steps, Jenkins should be installed and running on your Ubuntu machine. To access the Jenkins web interface, open a web browser and go to the following URL: http://localhost:8080. You will be prompted to enter the initial admin password, which you can find by running the following command:

1
sudo cat /var/lib/jenkins/secrets/initialAdminPassword


Enter this password in the web interface to complete the setup process.