Overview
Create a Linux virtual machine in the Azure portal
Sign in to Azure
Sign in to the Azure Portal: Go to the Azure Portal and sign in with your credentials.
Create virtual machine
Step 1: Search for Virtual Machines:
- In the search bar, enter Virtual machines. Under Services, select Virtual machines.
Step 2: Create a New Resource Group:
- In the Basics tab, under Project details, select the correct Subscription.
- Choose Create new to create a new resource group.
- Enter myResourceGroup as the name.
Step 3: Configure VM Basics:
- Under Instance details, enter myVM as the name of your virtual machine.
- For Image, select Ubuntu Server 24.04 LTS – Gen2.
- You may leave other settings at their default values.
Note: The default size and pricing shown are examples only. Availability and pricing may vary depending on your region and subscription. For optimal performance, consider a configuration with 4 vCPUs and 16 GiB of memory.
Step 4: Set up SSH Credentials:
- Under the Administrator account, select SSH public key.
- In Username enter azureuser.
- For SSH public key source, leave the default of Generate new key pair, and then enter myKey for the Key pair name.
Step 5: In the Disks tab, please set it as default.
Step 6: Leave the remaining defaults and then select the Review + create button at the bottom of the page.
Step 7: On the Create a virtual machine page, you can see the details about the VM you are about to create. When you are ready, select Create.
Step 8: When the Generate new key pair window opens, select Download private key and create resource. Your key file will be downloaded as myKey.pem. Make sure you know where the .pem file was downloaded; you will need the path to it in the next step.
Step 9: When the deployment is finished, select Go to resource.
Step 10: On the page for your new VM, select the public IP address and copy it to your clipboard.
If you’re looking for a more in-depth, step-by-step guide on how to connect to your newly created Azure instance via SSH, be sure to check out our detailed tutorial here:
How to Connect to Azure Instance Using SSH.
This resource covers additional troubleshooting tips, best practices for key management, and advanced configuration options to ensure a smooth and secure connection to your Azure environment.
By following the steps above, you’ve successfully created a new virtual machine with Ubuntu Server 24.04 LTS, set up secure SSH access, and generated a key pair for authentication. After finalizing the configuration and deployment, you obtained the VM’s public IP address, allowing you to connect remotely. We hope this article helps you save time and effort. Please feel free to contact us if you need any additional support.