Articles → DevOps → Install Jenkins On Linux Machine
Install Jenkins On Linux Machine
Steps
- Login to the linux server either using putty or the MobaXTerm.
- Switch to the root user role by using the following command.
- Execute the following command.
sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
Click to Enlarge
- Post that, execute the following commands.
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
yum install jenkins
- Once the above command is executed, check if the jenkins service is enabled or not. We can use the following command.
Click to Enlarge
Click to Enlarge
- As the Jenkins is using the 8080 port. So, we have to enable it in Azure. For that, go to the virtual machine and add an inbound port in the "Network" menu.
Click to Enlarge
- Finally open the Putty.
- Enter either the Host Name Or the IP address.
Click to Enlarge
- Go to the "Connection" → "SSH" → "Tunnels".
- Enter the source port as 8080 and Destination as 127.0.0.1:8080 and click on the "Add" button.
Click to Enlarge
- Finally click on the "Open" button to connect to the server.
- A screen will appear to enter the username and password.
- Now, you can open the following URL. A page will appear to enter the administrator password.
Click to Enlarge
- To get the password, you have to execute the following command.
cat /var/lib/jenkins/secrets/initialAdminPassword
Click to Enlarge
- Paste the password and click on the "Continue" button.
- Another screen will appear where you can click on the "Install Suggested Plugins" button.
Click to Enlarge
- All plugins are installed.
Click to Enlarge
- Another screen will appear where you can create the admin user. Enter the details and click on the "Save and Continue" button.
Click to Enlarge
- Another screen will appear to configure the instance configuration. Click on the "Save and Finish" button.
Click to Enlarge
Click to Enlarge