DEV Community

Cover image for How to create a linux VM on Azure (using PowerShell and install ‘NGINX’ Engine)
Henry
Henry

Posted on

How to create a linux VM on Azure (using PowerShell and install ‘NGINX’ Engine)

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

Image description

Image description
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

Image description

Image description

Image description

Image description

Image description
*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
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

Image description

Image description
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

Image description

Image description

Image description

Image description

Image description

Image description

Image description
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
CONGRATS YOU HAVE SUCCESSFULLY INSTALLED NGINX INTO YOUR AZURE VM LINUX MACHINE

Top comments (0)