MAAS × LXD

01 · Install and Initialize MAAS

We will install MAAS from the Snap store, set up a local PostgreSQL database, and initialize MAAS in Region+Rack mode on one box.

Why this order?

MAAS needs a database before it can initialize. Using Postgres gives you a production-worthy setup from day one.

Terms

Region = API/DB. Rack = worker functions like DHCP, TFTP, and power control. We run both on the same host for a compact lab.

Install snaps

sudo snap install maas --channel=stable
sudo snap install maas-cli --channel=stable
maas --version

Install PostgreSQL

sudo apt update
sudo apt install -y postgresql
sudo -u postgres psql -c "create user maas with encrypted password 'maas'"
sudo -u postgres createdb -O maas maasdb
echo "host maasdb maas 127.0.0.1/32 md5" | sudo tee -a /etc/postgresql/*/main/pg_hba.conf
sudo systemctl restart postgresql

Initialize MAAS (Region+Rack)

sudo maas init region+rack --database-uri "postgres://maas:maas@127.0.0.1/maasdb"
sudo maas createadmin

What you just did

You installed MAAS and gave it a database. createadmin created your first user and imported your SSH keys.

Common pitfalls

If init fails, check Postgres credentials and pg_hba.conf.