We will install MAAS from the Snap store, set up a local PostgreSQL database, and initialize MAAS in Region+Rack mode on one box.
MAAS needs a database before it can initialize. Using Postgres gives you a production-worthy setup from day one.
Region = API/DB. Rack = worker functions like DHCP, TFTP, and power control. We run both on the same host for a compact lab.
sudo snap install maas --channel=stable
sudo snap install maas-cli --channel=stable
maas --version
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
sudo maas init region+rack --database-uri "postgres://maas:maas@127.0.0.1/maasdb"
sudo maas createadmin
You installed MAAS and gave it a database. createadmin
created your first user and imported your SSH keys.
If init fails, check Postgres credentials and pg_hba.conf
.