$ ssh <username>@<Public-IP-Address>
ssh <username>@<Public-IP-Address>
ssh <username>@<Public-IP-Address>
-weight: 500;">apt -weight: 500;">install nginx
-weight: 500;">apt -weight: 500;">install nginx
-weight: 500;">apt -weight: 500;">install nginx - Introduction
- Prerequisites
- Step 1: Create the Linux VM on Azure.
- Step 2: Configure the Idle timeout.
- Step 3: Access the Linux Virtual machine with a terminal.
- Step 4: Install Nginx on a Linux Server.
- Step 5: Test Nginx Installation. - An Azure account with an active subscription. Login/Sign-up
- A terminal on your Mac, Windows, Linux, or even VS Code. - Search for and select Virtual machines in your Azure account. - Click on + Create and select "Virtual machine. - For Resource group select Create new. Give your resource group a name and select OK to save your changes.
- Give the virtual machine a name.
- Select a Region.
- Select the preferable Availability options and Security type; for the sake of this tutorial, we will be picking the lowest of each to save cost. - Select Image as Ubuntu Pro 24.04 LTS - x64 Gen2 or any other Linux image.
- Check the Run with Azure Spot discount box to minimize cost. - Scroll down to the Administrator account section and select Password for the Authentication type.
- Give it a Username and Password. - Select HTTP and SSH in the Select Inbound Ports dropdown. This allows IP addresses to connect to the Linux VM. - Click Next until you reach the Monitoring tab, click on Disable under the Boot diagnostics, and then click Review + Create. - Click on the 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. - Go to resource. - Now the VM is opened. Navigate to Configuration under Settings.
- Locate Idle timeout (minutes) increase to 30 minutes
- Apply changes. - Select Connect button in the Overview of the virtual machine blade in the Azure portal.
- Confirm access by clicking Check access. - Open a terminal and connect to your VM using SSH command format: - Or Copy directly from the Azure portal and paste in terminal. For this tutorial we would be using the Windows command prompt.
- Enter yes and then your password (not visible while typing in Linux). - Make sure that you are logged in as root; use the command - Update the Linux package list with the command - To -weight: 500;">install Nginx, just enter the command -weight: 500;">apt (which is the package manager of Linux), -weight: 500;">install (this is a verb and the action that you want the package manager to perform), and nginx (this is what you want to -weight: 500;">install on the VM). - Now that you have successfully installed Nginx, test it by putting the IP address of the VM into a browser.