A homelab is a educational & hobby learning environment for all software & hardware. It can be set up with no budget or a very large budget. This can be configured using virtualization (like Virtualbox) or a hardware-centric setup.
Azure has a $200 credit free trial available for new users of cloud services. This is ideal for the homelab because it is a risk free learning environment that reduces the burden of using bare-metal hardware.
You are going to want to set up a free trial for Microsoft Azure ($200 credit/month). You can use a throwaway Protonmail email for this, feel free to use all of your normal information when setting this up. Typically you will need to access the account using 2FA. You will login in order to view your dashboard.
Basics tab configuration:
homelab1ResourceGroup1Basics tab configuration:
homelabnet1Basics tab configuration:
homelablogs1Diagnostic Setting configuration:
blob-storage-logsStorageBlobLogs
| where TimeGenerated > ago(1h)
| project TimeGenerated, OperationName, StatusCode, Uri, CallerIpAddress
| order by TimeGenerated desc
Add New Container
homelab-containerBasics tab configuration:
homelab-vmAdministrator Account configuration:
azureuser homelab-vm_keyInbound Port rules:
Disk configuration:
Networking configuration:
homelabnet1)snet-eastus-1)homelab-vm-ipManagement (optional cost savings):
.pem file somewhere safe (e.g., Downloads folder)You'll see instructions, but follow the below steps
Click the Cloud Shell icon (>_) in the top menu bar
.pem file you downloaded# Set correct permissions on the key
chmod 400 homelab-vm_key.pem
# Get your VM's public IP (or copy it from the portal)
VM_IP="xx.xxx.xx.xx"
# SSH into the VM
ssh -i homelab-vm_key.pem azureuser@$VM_IP
# Confirm adding SSH key
yes
# Test the VM
whoami
# Update package list
sudo apt-get update
# Install Azure CLI
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
az --version
exit
Azure Subscription 1homelab1# Login using managed identity
az login --identity
# Set variables (replace with your actual values)
STORAGE_ACCOUNT="homelab1"
CONTAINER="homelab-container"
# List blobs in your container
az storage blob list \
--account-name $STORAGE_ACCOUNT \
--container-name $CONTAINER \
--auth-mode login \
--output table
Expected output:
You should see your test file listed! Something like:
Name Blob Type Length Content Type
-------- ----------- -------- --------------
test.txt BlockBlob 42 text/plain
az storage account show \
--name homelab1 \
--resource-group ResourceGroup1 \
--query networkRuleSet \
--output json
Search for "Virtual machines" → Click + Create → Azure virtual machine
Basics tab configuration:
Disks tab:
Networking tab:
Virtual network: Click "Create new"
Name: vnet-security-stack
Address space: 10.0.0.0/16
Subnet: Click "Manage subnet configuration"
Name: subnet-apps
Address range: 10.0.1.0/24
Public IP: (new) vm-security-stack-ip NIC network security group: Basic Public inbound ports: Allow selected ports Select inbound ports: SSH (22) Delete NIC when VM is deleted: ☑
Management tab:
Enable auto-shutdown: ☑ Shutdown time: 7:00 PM (or your preference) Time zone: [Your timezone] Notification before shutdown: Optional Boot diagnostics: Enable with managed storage account
Review + create:
.pem file) when prompted~/Downloads/vm-security-stack_key.pem)Get your VM's public IP:
Set proper permissions on SSH key (if using Linux/Mac):
chmod 400 ~/Downloads/vm-security-stack_key.pem
Connect via SSH:
# Replace <PUBLIC_IP> with your actual IP
ssh -i ~/Downloads/vm-security-stack_key.pem azureuser@<PUBLIC_IP>
On Windows (PowerShell):
ssh -i C:\Users\YourName\Downloads\vm-security-stack_key.pem azureuser@<PUBLIC_IP>
First time connecting:
yes and press EnterYou should see:
Welcome to Ubuntu 24.04.3 LTS (GNU/Linux 6.2.0-1018-azure x86_64)
...
azureuser@vm-security-stack:~$
Update the system:
sudo apt update && sudo apt upgrade -y
Install essential tools:
sudo apt install -y \
curl \
wget \
git \
htop \
net-tools \
ufw \
fail2ban \
unattended-upgrades
Set timezone (optional):
# List available timezones
timedatectl list-timezones | grep America
# Set your timezone (example: Eastern Time)
sudo timedatectl set-timezone America/New_York
# Verify
timedatectl
Enable automatic security updates:
sudo dpkg-reconfigure -plow unattended-upgrades
# Select "Yes" when prompted
In the next writeup, I will explain how to configure Tailscale VPN for secure tunneling into your Azure VM.