# Demoboot Guide

## Introduction

Installing and configuring Openfire is not particularly difficult (see: Install Guide. It can, however, be a tad cumbersome, especially when it needs to be done repeatedly. In plenty of scenarios, like a quick demo, or a verification that some change has the desired effect, it can be beneficial to be able to quickly launch Openfire into a functional state, without having to manually go through its setup.

The 'demoboot' setup of Openfire allows one to start a fresh installation of Openfire into a certain provisioned state, without running any of the setup steps. This guide describes how to use this mode.

Topics that are covered in this document:

## Demoboot Overview

The 'demoboot' setup of Openfire allows one to start a fresh installation of Openfire into a certain provisioned state, without running any of the setup steps. When running in 'demoboot' mode:

- Openfire is configured to use an embedded database, which requires no setup
- an administrative account is created using the username 'admin' and password 'admin'
- two users are automatically created: 'jane' and 'john', both using the value 'secret' as their password, and who are on each other's contact list
- the XMPP domain name is configured to be 'example.org' (for ease of use, configure 'example.org' to be an alias of '127.0.0.1' in your hosts file!)

To start Openfire in 'demoboot' mode, you can invoke the Openfire executable using the `-demoboot` argument, as shown below.

Starting Openfire in 'demoboot' mode.

    $ ./bin/openfire.sh -demoboot

That is all! You should now be able to use Openfire! It's administrative console is accessible via a browser on http://localhost:9090 (the credentials are 'admin'/'admin'). An XMPP client can be used to log into the server on the default ports (eg: 5222) using both the 'jane@example.org' and 'john@example.org' accounts (password: 'secret').

There's one caveat: in demoboot-mode, the TLS certificates that are used are self-signed. Some software requires special configuration to accept such a certificate when a connection to Openfire is being established.

## Usage while Developing

Demoboot mode is particularly useful while modifying Openfire's source code. To quickly and repeatedly compile, build and start Openfire, using demoboot in combination with the Maven wrapper allows for a one-line instruction, executed from the root of Openfire's source code, does it all:

Compile, build and start Openfire in 'demoboot' mode.

    $ ./mvnw package && ./distribution/target/distribution-base/bin/openfire.sh -demoboot

Demoboot can be combined with other options. In the following example, the Maven build is modified to explicitly clean a previous build (to remove any lingering artifacts), and to skip unit testing (which can take up time). Openfire is started in demoboot mode, but also in debug mode, allowing a remote debugger to be attached.

Compile, build and start Openfire in 'demoboot' mode.

    $ ./mvnw clean package -Dmaven.test.skip && ./distribution/target/distribution-base/bin/openfire.sh -debug -demoboot

## Customize Demoboot

Demoboot mode can be very useful, but there are scenarios in which it is desirable to have a slightly different provisioning take place. This section describes how to modify the demoboot mode.

Demoboot is only a very thin wrapper around the autosetup feature of Openfire, that's described in Openfire's Install Guide. Because of this, the provisioning that's performed by demoboot can easily be modified.

The provisioning that takes place in Demoboot mode is defined in the configuration file named `openfire-demoboot.xml`. This file is found in the `conf` directory of an installed version of Openfire, and in `distribution/src/conf` of Openfire's source code.

This file can be modified using the instructions in the 'autosetup' section of Openfire's Install Guide, which will allow you to modify the mode as you see fit!