How to create a linux VM on Azure (using PowerShell and install ‘NGINX’ Engine)
Published: 2024-05-27 11:51:49

**Step 1: Login to Azure portal and create a Virtual Linux Machine” **

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e2nw33lrl217u73r3io9.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bfcl8nh95od8wmmfn02v.png)
**Select resource group, name the VM , choose a region , select the image type “Ubuntu 22.04” or any latest. 
Select password for authentication types and add details for authentication
For Public ports rules, allow all ports because we will be communicating with the VM through an IP address on powershell.
Then click review and create, wait for deployment and go to resource group.**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kw9c4zsrro83am365833.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9p1dtu85k2d8pygeqidm.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f37tzrn68l6bpy5gwnw9.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9jrdjmlga9rmbxv2d3ni.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2dvgnlyrmqe7w99i4umz.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tmufrt18xh0uj0mngxra.png)
**Click on the IP address to increase the idle timeout to max, to enable us communicate with it more without shutting down then save.
Go back to the VM and copy the IP address **

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mbhmxdzfc744xqaiqo6h.png)
**Step 3. Open powershell as admin on your computer and input this command 
“ssh “your vm user name”@”IP address of the VM” . to establish communication.
Enter ‘yes”to continue, enter VM password**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6lhv6cxy98mk37mjncw8.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8e5angg991160gxr383o.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sp431x47m822eirihv9a.png)
**Now your VM has established communication, Now to install the engine, we have to enter the root of the VM to install the engine , 
Enter the command “sudo so”
Then include the command “apt update” to update any latest requirement, then “apt install nginx” enter Yes for confirmation**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/376r5atwrdk6ds6rd86a.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fdwreurcc7o6ez6eiiju.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/31oerbfxshqtdaten81a.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ejk4rf0u8125pd3wll9f.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/su3248mspoii0vikujy8.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pne2cssvz0zs6d6ckvg4.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o4oogqhwh26272r9ftt1.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/trstb682tl485xvuwx4j.png)
When its 100%, Congrats, you have installed the engine. 

**Step 4: Go to the IP address, copy it and paste it onto a new tab. **

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ni2k7bmgsqzm9ole2jsu.png)
**CONGRATS YOU HAVE SUCCESSFULLY INSTALLED NGINX INTO YOUR AZURE VM LINUX MACHINE**