.. -*- mode: rst -*-

***************
Installing MAAS
***************

There are two main ways to install MAAS:

 * as part of a fresh Ubuntu install using the Ubuntu Server installer
 * or from Ubuntu's archive on an existing Ubuntu install.

This is a guide to installing MAAS from the Ubuntu archive.

It assumes that you're working with:

 * a fresh Ubuntu 12.04 LTS install
 * a machine dedicated to running MAAS
 * control of the network your machine is connected to
 * internet access or a local mirror of the Ubuntu archive.


Installing MAAS from the archive
================================

Installing MAAS is straightforward. At the command-line, type::

  $ sudo apt-get install maas

From a fresh Ubuntu 12.04 LTS install, MAAS will pull down around 200
MB of packages.


Creating a superuser account
----------------------------

Once MAAS is installed, you'll need to create your first administrator
account::

  $ maas createsuperuser

Follow the prompts and MAAS will create an admin account that you can
later use to log in.


Configuring a DHCP server
=========================

So that MAAS can PXE boot machines, you'll need a DHCP server. MAAS
can work with your existing DHCP set-up but for this guide we'll use
dnsmasq.

dnsmasq should already be installed; install it if not::

  $ sudo apt-get install dnsmasq

MAAS enlists nodes using a tool called Cobbler. Cobbler provides a
configuration file for dnsmasq: ``/etc/cobbler/dnsmasq.template``.

Make the following changes:

``domain``
  If applicable, specify your network's domain.

``dhcp-range``
  Specify the range from wluke haineshich dnsmasq should allocate IP
  addresses to servers in your MAAS.

``dhcp-option=3,next_server``
  Replace ``next_server`` with the current server's IP address.

Save that file and now edit the Cobbler settings file:
``/etc/cobbler/settings``.

You need to change two settings:

``manage_dns``
  Change the 0 to 1

``manage_dhcp``
  Again, change the 0 to 1.

Now restart dnsmasq::

  $ sudo /etc/init.d/dnsmasq restart


Import the Ubuntu images
========================

MAAS will check for and download new Ubuntu images once a
week. However, you'll need to download them manually the first time::

  $ sudo maas-import-isos


Next steps
==========

Your MAAS is now ready for use. Visit the MAAS web interface in your
browser at http://localhost/MAAS.

Now, :doc:`let's prepare your Juju environment <juju-quick-start>`.
