🏠Back to Home | 📚 More Blogs |
Managing bare-metal servers with the same ease as cloud instances is a dream for many DevOps and infrastructure teams. That’s where MAAS (Metal-as-a-Service) comes in. By combining MAAS with a UDM Pro, you can automate Ubuntu deployments using PXE boot, VLANs, and DHCP—bringing cloud-like provisioning to your on-prem servers.
In this guide, I’ll walk through how to set up MAAS with UDM Pro to fully automate bare-metal server provisioning.
Together, they create a powerful, cloud-like provisioning system for physical infrastructure.
bootloader/uefi/amd64/grubx64.efi
Add a firewall rule for PXE/TFTP traffic:
Rule details:
sudo add-apt-repository ppa:maas/3.4 -y
sudo apt update
sudo apt install maas maas-cli maas-dhcp maas-dns -y
sudo maas init
After installation, you need to create the first admin user.
sudo maas createadmin
This will ask for:
admin
)Once done, MAAS will be accessible at:
👉 http://<your-maas-server-ip>:5240/MAAS
maas login admin http://<your-maas-server-ip>:5240/MAAS <API_KEY>
To allow passwordless SSH login to deployed machines, import your public SSH key.
~/.ssh/id_rsa.pub
or ~/.ssh/id_ed25519.pub
.maas admin sshkeys create "key=$(cat ~/.ssh/id_rsa.pub)"
Now, any machine deployed via MAAS will automatically have your SSH key injected.
sudo maas admin boot-resources import
maas admin boot-resources read | jq '.[] | {name, type, architecture, complete}'
Check boot files:
ls /var/lib/maas/boot-resources/uefi/
Example CLI setup:
maas admin fabrics read | jq '.[] | {id, name}'
maas admin vlans read 0 | jq '.[] | {id, name, vid, dhcp_on}'
maas admin vlan update 0 1 dhcp_on=true primary_rack=bareops
maas admin subnets create cidr=X.X.X.0/24 gateway_ip=X.X.X.X fabric=0 vlan=1
Commission hardware:
maas admin machine commission <SYSTEM_ID>
Accept and mark as ready:
maas admin machine accept <SYSTEM_ID>
maas admin machine update <SYSTEM_ID> status=Ready
Deploy Ubuntu:
maas admin machine deploy <SYSTEM_ID> distro_series=jammy hwe_kernel=hwe-22.04
By default, MAAS sets up SSH key authentication. To enable password login:
PasswordAuthentication yes
PermitEmptyPasswords no
UsePAM yes
KbdInteractiveAuthentication yes
sudo mkdir -p /etc/ssh/sshd_config.d
echo -e "PasswordAuthentication yes\nKbdInteractiveAuthentication yes" | \
sudo tee /etc/ssh/sshd_config.d/01-password.conf
sudo systemctl restart sshd
sudo passwd ubuntu
Now you can log in with password auth, even via GUI clients like Remmina.
sudo systemctl stop maas-regiond maas-rackd
sudo rm -rf /var/lib/maas/regiond/cache/*
sudo rm -rf /var/lib/maas/boot-resources/*
sudo systemctl start maas-regiond maas-rackd
sudo maas admin boot-resources import
sudo tail -f /var/log/maas/rackd.log
By combining MAAS with UDM Pro, you can bring cloud-like automation to your bare-metal infrastructure. From creating users and importing SSH keys to commissioning and PXE boot deployments, everything can be managed remotely—perfect for home labs, staging, or production environments.
🏠Back to Home | 📚 More Blogs |