Ubuntu Server 20.04 LTS on Azure User Guide
Overview
This guide covers the deployment and configuration of Ubuntu Server 20.04 LTS (Focal Fossa) on Microsoft Azure using cloudimg's pre configured virtual machine image from the Azure Marketplace.
What's included:
- Ubuntu Server 20.04 LTS (Canonical's standard security maintenance ended in May 2025; extended security maintenance requires an Ubuntu Pro subscription, which is not included)
- Azure Linux Agent (waagent) for cloud integration
- Chrony (chronyd) for NTP time synchronisation
- Gen2 Hyper V virtual machine support
- APT package management with Ubuntu repositories
- 24/7 cloudimg support
Platform: Microsoft Azure (Gen2 Hyper V)
Login user: the administrator username you choose when you deploy (azureuser in the examples below). The image honours the authentication type you pick in the portal: SSH public key (recommended) or password.
Prerequisites
Before deploying this image, ensure you have:
- An active Microsoft Azure subscription
- Access to the Azure Portal or Azure CLI
- An SSH key pair (recommended) or a strong password for Linux VM access
- Familiarity with Azure VM management
Recommended VM Size: Standard_B2s (2 vCPU, 4 GB RAM) or larger.
Step 1: Deploy the Virtual Machine
Option A: Azure Portal
- Navigate to the Azure Marketplace and search for "Ubuntu Server 20.04 LTS on Azure cloudimg"
- Select the image and click Create
- Configure the basics:
- Subscription: Select your Azure subscription
- Resource Group: Create new or select existing
- Virtual Machine Name: Enter a name for your VM
- Region: Select your preferred Azure region
- Size:
Standard_B2srecommended - Under Administrator Account, choose the username you want to log in as, then select SSH public key (recommended) and enter your key, or select Password and set a strong password
- Under Inbound Port Rules, allow SSH (port 22)
- Click Review + Create, then Create
Option B: Azure CLI
az vm image terms accept --urn cloudimg1647283583153:ubuntu-20-04:default:latest
az vm create \
--resource-group myResourceGroup \
--name my-ubuntu-server-20-04-azure-vm \
--image cloudimg1647283583153:ubuntu-20-04:default:latest \
--size Standard_B2s \
--admin-username azureuser \
--generate-ssh-keys \
--public-ip-sku Standard
Step 2: Connect via SSH
Once your VM is running, connect using SSH:
ssh azureuser@<public-ip-address>
To find your VM's public IP:
az vm show --resource-group myResourceGroup --name my-ubuntu-server-20-04-azure-vm --show-details --query publicIps -o tsv
Step 3: Verify the Installation
After connecting, verify the operating system:
cat /etc/os-release
uname -r
Check disk space and memory:
df -h
free -h
Verify the Azure Linux Agent is running:
systemctl status waagent
Step 4: Update the System
Keep your system up to date with the latest security patches:
sudo apt-get update && sudo apt-get upgrade -y
Step 5: Configure Firewall (Optional)
The Azure Network Security Group (NSG) controls inbound and outbound traffic. Ubuntu's own firewall, ufw, ships inactive; check it with:
sudo ufw status verbose
To enable it, always allow SSH first so you do not lock yourself out, then allow any other ports you need:
sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enable
Common Use Cases
- Web application hosting (LAMP, MEAN, MERN stacks)
- Container and Docker workloads
- Database hosting (MySQL, PostgreSQL, MongoDB)
- Development and CI/CD environments
Troubleshooting
Cannot Connect via SSH
- Verify the VM is in Running state in the Azure Portal
- Check that port 22 is allowed in the Network Security Group
- Ensure you are using the administrator username you chose at deployment (
azureuseronly if you kept the example), and the matching key or password - Verify your SSH key matches the one configured during deployment
Azure Agent Not Running
sudo systemctl start waagent
sudo systemctl enable waagent
Package Manager Issues
sudo apt-get update && sudo apt-get upgrade -y
If repositories are unreachable, check DNS resolution:
nslookup google.com
Important Notes
Ubuntu is free and open source. No licence required.
Support
For assistance with this image, contact cloudimg support:
- Website: www.cloudimg.co.uk
- Product Catalogue: www.cloudimg.co.uk/products
- User Guides: www.cloudimg.co.uk/guides
- SLA: 24 hour response guaranteed