Step-by-Step Guide to Creating a Linux VM and installing nginx on it
Step 1: Search & Select Virtual Machine on Azure Portal.
Step 2: Select Create + and click on Azure Virtual Machines.
Step 3: For Resource Group select Create New, Give your resource group a name and click on OK to save changes.
Step 4: Provide a Virtual Machine name. Ensure the name is unique and meets the naming requirements.
Step 5: Select Images & Choose Ubuntu Server 20.04.
Step 6: Go to the Administrator Account and Create a Username & Password.
Step 7: In the Inbound port roles, select HTTP & SSH.
Step 8: Go to Monitoring, Disable Boot Diagnostics.
Step 9: Click on the “Review + Create” button. If the validation passes, the deployment will proceed. If not, note any recommendations, fix them, and try again. Deployment might take 3-5 minutes.
Step 10: Once the VM is deployed, find its Public IP Address in the Overview tab.
Step 11: Open a terminal(like Windows Powershell or use an SSH client like PuTTY) and connect to your VM using SSH
• Replace and with your VM's details.
• Enter yes and then your password (not visible while typing in Linux).
• Make sure that you are logged in as root use the command - sudo su.
Step 12: Once connected, run the following commands to ensure the package list is to up-to-date.
• apt update
Step 13: Install nginx on a Linux Server
• Type the command $ apt install nginx.
apt(Is the package manager of nginx)
install(This is a verb and the action that you want the package manager to perform), nginx (This is what you want to install on the VM).
Step 14: Test Nginx Installation
• We can verify the installation by pasting the IP Address of the VM in a browser.
By following these steps, you've successfully created a Linux VM in Azure and installed Nginx. This setup is ready to serve web traffic and can be scaled based on your requirements. You can now begin deploying web applications customizing NGINX as needed
Top comments (0)