.. _installing on existing Debian host:

====================================================================
Installing on an existing Debian host or using standard Debian ISOs
====================================================================

Bonding can be installed using regular Debian methods in one of two
ways:

#. Installing on an existing Debian Jessie host
#. Installing using a standard Debian Jessie ISO while loading a preseed
   file

These methods are described below.

Installation on an existing Debian host
----------------------------------------

.. note::
    Debian 8 ends upstream support on June 30, 2020. It is not recommended to
    use for new provisions.

Bonding can be installed on the following platforms:

* i386 Debian 8 (Jessie)
* amd64 Debian 8 (Jessie)
* amd64 Debian 9 (Stretch)
* amd64 Debian 10 (Buster)

To install on an existing host, overwrite the contents of
``/etc/apt/sources.list`` with the APT sources listed on the Node Setup
tab of your space.

Then run:

::

    apt-get update
    apt-get install bonding -y

The installer will prompt for the management server URL and node key, as
explained in `Initial Bonding
configuration <../../provisioning-nodes/node-installation-methods/cloning-from-template-image.html>`__.

Bonded Internet is now installed on the host. Then reboot the host to
ensure all services start and settings are applied:

::

    reboot

Finally, update the bond or aggregator record on the management server
with the root or user password on that device, or reset the password on
the device to the password recorded in the management server.

Installation using a standard Debian Jessie ISO and preseed file
-----------------------------------------------------------------

.. warning::
    Debian 8 (Jessie) leaves LTS support on June 30, 2020 and the installation media
    may also stop functioning at that time. It is advised to not deploy new nodes
    on this platform and instead use Debian 9 or Debian 10.

A new node can be provisioned from a standard Debian 8 ("Jessie") amd64
or i386 ISO while specifying a preseed file. A preseed file is a special
Debian configuration file that specifies how a new host should be
configured as the operating system is installed. It allows configuration
choices to be taken from the file instead of asked of the user,
simplifying the installation process. The custom Bonded Internet ISOs
contain embedded preseed files to streamline the installation, but a
standard Debian Jessie ISO can use the same preseed files by downloading
them at boot time over the network.

To use this method, download a Debian Jessie installer CD from
http://www.debian.org/CD/. The netinst CD is preferred because of its
small size. Choose either the i386 or amd64 architecture, depending on
whether the device has a 32-bit or 64-bit CPU. Make a `bootable USB
key <../../provisioning-nodes/creating-bootable-usb-disks-from-iso-images.html>`__ or
burn the ISO to a CD.

Decide which `configuration
profile <../../provisioning-nodes/installation-configuration-profiles.html>`__ to use.
Provide the URL of the configuration profile, as follows:

#. Image with node key: /preseed.cfg
#. Static IP (Aggregator): /preseed-net.cfg

Boot from the disk. Wait until the installer menu appears, and press
Esc. Type the following:

::

    auto url=http://<bondingadmin domain><URL of preseed file>

and press Enter.

For example, to use the fully automatic preseed file for a management
server whose URL is
`bondingadmin.example.com <http://bondingadmin.example.com>`__, you
would type:

::

    auto url=http://bondingadmin.example.com/preseed.cfg

.. note::

    Do not use the HTTPS URL—only HTTP works, due to the Debian installer
    not loading SSL libraries at that early part of the installation.

The installation process will use the configuration in the preseed file,
just as if you had used a custom Bonded Internet ISO. Near the end of
the process, the installer will prompt for the node key as explained
in `Initial Bonding
configuration <../../provisioning-nodes/initial-bonding-configuration.html>`__.
