This content originally appeared on DEV Community and was authored by JICDev
Microsoft Azure makes it easy to deploy virtual machines (VMs) that run Linux. Whether you want to test an application, host a service, or learn Linux administration, setting up a VM in Azure is a great way to get started.
This guide will walk you through creating a Linux VM on Azure Portal step by step.
Step 1: Sign in to Azure Portal
- Go to https://portal.azure.com.
- Log in with your Azure account credentials.
- You’ll land on the Azure Home dashboard.
There after your interface should look like the image below. Now you can click on Virtual Machine (VM). Mind you, you can also use the search bar for this purpose.
Step 2: Click on Create
Step 3: Configure Basics - This is where you fill in all the modalities of the virtual machine. You would select as below:
Subscription → Choose your subscription.
Resource Group → Select an existing one or click Create new Click here to learn how to do so. After creating your resource, then you select the resource you created.
Virtual machine name → Example:
TestMachine
.Region → Choose the closest region to you or your users (e.g., East US, West Europe). NB: This can have an impact on the costing.
- Availability options → Leave as default for a simple setup. However, you choose zone if you what your Vm to be deployed to different zones. Mind you, the more the zones, the higher the pricing. For this test, kindly choose "No infrastructure redundancy required"
Select your image* Here you would see various operating system available. Since we are creating for a Linux VM we would use the Ubuntu Server 24.04 LTS as in the image below:
- Size → Pick a VM size (e.g., Standard_B1s for testing "if you are using a free account" But if you are using a pay as you go account you can use any other that fits your needs".
Step 4: Administrator Account
Set up the login details:
- Authentication type → Choose SSH public key (recommended) or Password.
-
Username → Enter a Linux username (e.g.,
Testuser1
). -
SSH public key source →
- If you already have a key, paste the public key.
- Or generate a new one inside the portal.
🔹 Step 5: Inbound Port Rules
To connect via SSH, you need to allow port 22.
- Public inbound ports → Select Allow selected ports.
- Select inbound ports → Check SSH (22).
Security Note: For production, it’s better to allow SSH only from your IP.
🔹 Step 7: Review + Create
- Click Review + Create.
- Azure will validate your configuration.
- If validation passes, click Create.
Deployment will take a few minutes.
At this point you would be prompted to download the .pem file which would enable you to possible deploy the Linux VM
🔹 Step 8: Connect to Your Linux VM
Once the VM is deployed:
- Go to Virtual machines in the left menu.
- Select your new VM.
- Click Connect → SSH.
- Copy the SSH command provided, e.g.:
ssh -i ~/.ssh/id_rsa azureuser@<Public-IP>
- Run the command from your Windows PowerShell or a Linux terminal.
You’re now connected to your Linux VM! 🎉
Conclusion
Creating a Linux VM on Azure is straightforward: From here, you can start installing packages, hosting services, or experimenting with Linux commands.
This content originally appeared on DEV Community and was authored by JICDev

JICDev | Sciencx (2025-09-06T20:47:55+00:00) How to Create a Linux Virtual Machine in Azure Portal. Retrieved from https://www.scien.cx/2025/09/06/how-to-create-a-linux-virtual-machine-in-azure-portal/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.