0% found this document useful (0 votes)
1 views

Install Jenkins on Ubuntu in Azure VM

This document outlines the steps to create an Ubuntu virtual machine (VM) in Azure and install Jenkins on it. It includes detailed instructions for VM creation, configuring network settings, and installing necessary software like Java and Maven before setting up Jenkins. Finally, it describes how to access Jenkins through a web browser and complete the initial setup process.

Uploaded by

gcetly.2
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views

Install Jenkins on Ubuntu in Azure VM

This document outlines the steps to create an Ubuntu virtual machine (VM) in Azure and install Jenkins on it. It includes detailed instructions for VM creation, configuring network settings, and installing necessary software like Java and Maven before setting up Jenkins. Finally, it describes how to access Jenkins through a web browser and complete the initial setup process.

Uploaded by

gcetly.2
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Install Jenkins on Ubuntu in Azure VM

Virtual Machine creation and jenkins installation in Azure


Step 1: Create a VM in azure using the following steps.
Step 2: Install Jenkins

Virtual Machine Creation:

Select Create a resource option and then choose Virtual Machine Option:

In Virtual Machine page choose create option and proceed with following steps:
Select the name , resource group and OS for the VM along with the security option, size of the
server, user name, password and key generation.

Then click next option: Disk


In this page set the OS image size and choose required disk type (ssd,hdd)

Then proceed to next step : Networking

In this page don't change anything unless it needs to be modified. It is advised not to change
anything .

Then proceed to next step:

Click review and create:


Click create

After clicking create download the security key generated as it is very important to
connect with the VM.
Wait for Deployment of the VM.

Once deployed go to resources:

Now we have to set inbound ports to access the vm:

Open Network settings of the VM:


Click create new port rule and then inbound port rule.

Set the port to 8080 to make the vm accessible in that port address:
Now we have to connect the VM to our system:
For that open command prompt and type the following command : ssh -i
path-of-the-key-downloaded AzureUsername@IP-of-VM

Here i used the command : ssh -i C:\Users\cse\Downloads\cloud2_key.pem


[email protected]

Once connected you can assess the Azure vm with Ubuntu and from there you can
continue with the linux command for installing jenkins:
Installation op Jenkins:
Change Host Name to Jenkins
sudo hostnamectl set-hostname Jenkins

Perform update first


sudo apt update

Install Java 11
sudo apt install default-jdk -y

Once install java, enter the below command

Verify Java Version


java -version

Maven Installation
Maven is a popular build tool used for building Java applications. Please click here to learn more about
Maven. You can install Maven by executing below command:

sudo apt install maven -y

you can type mvn --version


you should see the below output.
Now lets start Jenkins installation

Jenkins Setup

Add Repository key to the system


curl -fsSL https://pkg.jenkins.io/debian/jenkins.io-2023.key | sudo tee \
/usr/share/keyrings/jenkins-keyring.asc > /dev/null

Append debian package repo address to the system


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

Update Ubuntu package


sudo apt update

Install Jenkins
sudo apt install jenkins -y
The above screenshot should confirm that Jenkins is successfully installed.

Access Jenkins in web browser

Now Go to Azure Portal console. Click on Jenkins VM, Copy the public IP address.

Now go to browser. enter public IP address with port no 8080.


http://AzureVM_public_IP:8080

Unlock Jenkins
You may get screen, enter the below command in Git bash( Ubuntu console)

Get the initial password from the below file


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

Copy the password and paste in the browser.


Then click on install suggested plug-ins.

Also create user name and password.


enter everything as admin. at least user name as admin password as admin
Click on Save and Finish. Click on start using Jenkins. Now you should see a screen like below:

You might also like