Tools: How to Build a Linux Virtual Machine with Microsoft Azure & Install Nginx on it (2026)

Tools: How to Build a Linux Virtual Machine with Microsoft Azure & Install Nginx on it (2026)

Table of Contents

Introduction

Prerequisite

Step 1: Create the Linux VM on Azure.

Step 2: Configure the Idle timeout and confirm access

Step 3: Access the Linux VM with a terminal.

Step 4: Install Nginx on a Linux Server.

Step 5: Test Nginx Installation.

Conclusion What is Linux? This is an open-source operating system (OS) for managing hardware and software on computers. It is free, customizable, and highly secured; it was created by Linus Torvalds in 1991 and powers the Android OS. What is Nginx? It is a free, popular open-source web server software (usually pronounced as "engine-x") used for load balancing, media streaming (audio, video, and images), reverse proxy, and caching. To successfully carry out this project, you will need the following: An Azure account with an active subscription. Login/Sign-up A terminal on your Mac, Windows, Linux, or even VS Code. Now that we understand these tools and have all we need, let's get right into deploying them. 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 the preferable Availability options and Security type; for the sake of this tutorial, we will be picking the lowest of each to save cost. 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 or customizing NGINX as needed. Thank you for reading my blog. 😊😊 If you need further assistance, feel free to reach out in the comments or hit me up on Twitter. You can also follow me on GitHub. My DMs are open, and love discussions on cloud topics as always! 😁 Oluwatofunmi Emmanuel Oluwaloseyi Templates let you quickly answer FAQs or store snippets for re-use. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse

Command

Copy

$ 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.