Deploy Jenkins on Azure Virtual Machine

A Handson Demo of deploying Jenkins on Azure VM

·

2 min read

Deploy Jenkins on Azure Virtual Machine
  1. First, let's go to our Azure Management dashboard, and in the top search bar search for "virtual machines" and click on it.

    How to create an Azure account for free

After a couple of minutes, you will see something like below on your management dashboard. which means, we have successfully created our Virtual Machine on Azure.

By default, all instances will deny all ports. But, to access our Jenkins server, we have to open a port on our VM. Which is shown in the below images.

Now, we are all set, Let's access our VM via any terminal of our choice [I am choosing mobaxterm ] we have other choices like putty, gitbash, azurecli, etc.

Note: In case of any issues, comment down below will reply ASAP.

$ ssh -i Jenkins-Server_key.pem azureuser@20.235.137.56

Once, we log in to our Virtual Machine, begin Jenkins deployment by making use of the below commands.

For Jenkins to be up and running, java is a pre-requisite. So, we are installing Java first then Jenkins installation.

# pre-requisite for jenkins is java
sudo apt update
sudo apt install openjdk-11-jre -y

java -version

 curl -fsSL https://pkg.jenkins.io/debian/jenkins.io-2023.key | sudo tee \
  /usr/share/keyrings/jenkins-keyring.asc > /dev/null
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
sudo apt-get update
sudo apt-get install jenkins -y
jenkins --version

Once installation is completed, we can access the Jenkins server by providing

HTTP:<VM IP>:8080 it on our web browser.

For the password, we have to go to our terminal and give cat <path visible with red color on jenkins started page>

After that follow the screen instructions to get Jenkins home UI.

Finally, we have successfully deployed Jenkins on our Azure virtual machine and got our Jenkins UI.

That's it for this blog, See you soon with yet another interesting blog post on DevOps/cloud technology.

Till then follow Nagacharan and read the other interesting blogs on DevOps & cloud technology and please don't forget to leave your feedback through comments💬 and likes👍.

Did you find this article valuable?

Support Nagacharan by becoming a sponsor. Any amount is appreciated!