Deploying an Ubuntu Linux VM on Microsoft Azure and Hosting a Website with Nginx

As part of my 90-project Cloud Engineering journey, I recently completed Project 3: deploying an Ubuntu Linux Virtual Machine on Microsoft Azure and configuring Nginx to host a custom static webpage.

The objective was to gain hands-on experience with cloud infrastructure, Linux administration, SSH authentication, network security, and web server configuration.

In this article, I'll walk through the implementation, the challenges I encountered, and what I learned.

Project Architecture

The deployment followed this architecture:

 Internet | Public IP Address | Azure NSG Rules | ---------------- | | SSH : 22 HTTP : 80 | | ---------------- | Ubuntu Linux VM | Nginx | /var/www/html/ | index.html 

Technologies Used

  • Microsoft Azure
  • Ubuntu 24.04 LTS
  • Azure Virtual Machines
  • SSH
  • Ed25519 SSH Key Pair
  • Network Security Groups (NSG)
  • Nginx
  • HTML
  • Windows PowerShell

1. Provisioning the Azure Virtual Machine

I started by creating a Linux Virtual Machine through the Azure Portal.

The configuration included:

Setting Configuration
VM Name linux-server-01
Operating System Ubuntu 24.04 LTS
Region Central India
VM Size Standard B2pts_v2
Architecture ARM64
vCPUs 2
Memory 1 GiB
OS Disk 30 GiB Standard SSD
Authentication SSH Public Key

The VM was deployed inside an Azure Virtual Network with a dedicated subnet and Network Security Group.

Azure VM Overview

2. Establishing SSH Connectivity

To access the Linux server remotely, I generated an Ed25519 SSH key pair.

I connected to the VM using Windows PowerShell:

ssh -i "./linux-server-key.pem" azureuser@<PUBLIC_IP> 

Initially, the connection failed because Windows considered the private key permissions too permissive.

I resolved this by modifying the Windows file access permissions so that only my user account could read the private key.

After correcting the permissions, I successfully established an SSH connection.

SSH Connection

3. Configuring Network Security Groups

Next, I configured inbound NSG rules to control access to the virtual machine.

The following rules were configured:

| Rule | Port | Protocol | Sourc