Create a Linux Virtual Machine

This guide walks you through the essential steps to deploy a Linux virtual machine (VM) in Azure using the Azure portal. Azure VMs provide scalable, on-demand computing resources.

Prerequisites

Step 1: Sign in to the Azure portal

Open your web browser and navigate to https://portal.azure.com. Sign in with your Azure account credentials.

Step 2: Create a Virtual Machine

  1. In the Azure portal, select Create a resource from the top menu (the plus sign).
  2. In the search box, type Virtual machine and select Virtual machine from the results.
  3. Click Create.

Step 3: Configure VM Basics

On the Basics tab, configure the following:

Step 4: Configure Disks

On the Disks tab, you can configure the operating system disk. For this quickstart, the default settings are fine.

Step 5: Configure Networking

On the Networking tab, you can configure networking settings. By default, Azure creates a virtual network, subnet, public IP address, and network security group. For this quickstart, the defaults are sufficient.

Step 6: Review and Create

Review the settings you've configured on the Review + create tab. Ensure everything is correct. You will also see an option to download the private key for your SSH public key pair. Download your private key now and save it securely.

Important: Keep your private key secure. You will need it to connect to your VM.

Click Create to start the VM deployment.

Step 7: Connect to the Virtual Machine

Once the deployment is complete (this may take a few minutes), you can connect to your VM.

  1. Navigate back to the Azure portal and find your virtual machine.
  2. On the Overview page, you will find the VM's public IP address. Copy this IP address.
  3. Open a terminal or SSH client on your local machine.
  4. Use the following command to connect, replacing <public-ip-address> with your VM's IP address and <path-to-private-key> with the path to the private key file you downloaded:
ssh -i <path-to-private-key> azureuser@<public-ip-address>

You might be prompted to confirm the host's authenticity. Type yes and press Enter.

Next Steps

Congratulations! You have successfully created and connected to your Azure virtual machine. You can now: